Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/web/components/assembly/AssemblyActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const usesCreatorAssembler = computed(() => {
});

const showLibraryButton = computed(() => {
return ((usesCreatorAssembler.value && libraryLoaded.value) || architecture.config.name.includes("SRV"));
return ((usesCreatorAssembler.value && libraryLoaded.value) || architecture?.config?.name?.includes("SRV"));
});

// Watch for architecture changes
Expand Down
2 changes: 1 addition & 1 deletion src/web/components/assembly/LibraryTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
computed: {
libraryLoaded() {
// Access libraryVersion to make this reactive to library changes
if (architecture.config.name.includes("SRV"))
if (architecture?.config?.name?.includes("SRV"))
return (
this.libraryVersion >= 0 &&
loadedLibrary && (libtags32.length !== 0 || libtags64.length !== 0) &&
Expand Down
16 changes: 7 additions & 9 deletions src/web/components/assembly/LoadLibrary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ export default defineComponent({
},

data() {
return {
return {
library: null,
compiler: architecture.config.name
};
compiler: architecture?.config?.name,
};
},
computed: {
file_accept() {
return (this.compiler.includes("SRV") ? ".o" : ".yml");
}
return this.compiler?.includes("SRV") ? ".o" : ".yml";
},
},

methods: {
load() {
// read file
if (!this.compiler.includes("SRV")) {
if (!this.compiler?.includes("SRV")) {
show_loading();
const reader = new FileReader();
reader.onload = _event => {
Expand All @@ -61,7 +61,7 @@ export default defineComponent({
} else {
show_loading();
const reader = new FileReader();
var arrayBuffer;
let arrayBuffer;
reader.onload = _event => {
try {
load_library_sail(new Uint8Array(reader.result), document.getElementById("binary_file").files[0].name);
Expand All @@ -70,8 +70,6 @@ export default defineComponent({
}
};
reader.readAsArrayBuffer(this.library!);


}
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/web/components/assembly/SaveLibrary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default defineComponent({
}
>,

compiler: architecture.config.name,
compiler: architecture?.config?.name,

/*Binary data*/
binaryHex: "",
Expand Down Expand Up @@ -202,7 +202,7 @@ export default defineComponent({
*/
async handleShown() {
// Compile as library
if (!this.compiler.includes("SRV")){
if (!this.compiler?.includes("SRV")){
const compiled = await this.compileAsLibrary();
if (!compiled) {
// Close modal if compilation failed
Expand Down Expand Up @@ -230,7 +230,7 @@ export default defineComponent({
*/
handleOk(evt: any) {
evt.preventDefault();
if (this.compiler.includes("SRV"))
if (this.compiler?.includes("SRV"))
this.library_save_sail();
else
this.library_save();
Expand Down Expand Up @@ -464,7 +464,7 @@ export default defineComponent({
title="File name"
/>
<small class="form-text text-muted"
>File will be saved as {{ name_binary_save || "library" }} {{ (compiler.includes("SRV")) ? ".o" : ".yml" }}</small
>File will be saved as {{ name_binary_save || "library" }} {{ (compiler?.includes("SRV")) ? ".o" : ".yml" }}</small
>
</b-form-group>
<hr class="my-4" />
Expand Down
4 changes: 2 additions & 2 deletions src/web/components/assembly/TextareaAssembly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ watch(
<template>
<!-- Editor monaco -->
<div class="editor-wrapper" :style="{ height: height }">
<div v-if="architecture.config.name.includes('SRV') && files.length >= 0" class="tabs-editor">
<div v-if="architecture?.config?.name?.includes('SRV') && files.length >= 0" class="tabs-editor">
<b-tabs content-class="mt-3" v-model="activeTabIndex">
<b-tab v-for="(tab, i) in files"
:key="tab.filename"
Expand Down Expand Up @@ -538,7 +538,7 @@ watch(

</b-tabs>
</div>
<div ref="editorContainer" class="monaco-editor-container" v-show="files.length > 0 || !architecture.config.name.includes('SRV')"/>
<div ref="editorContainer" class="monaco-editor-container" v-show="files.length > 0 || !architecture?.config?.name?.includes('SRV')"/>

<div id="vim-statusbar" class="vim-statusbar"></div>
<b-modal v-model="renameModalOpen" class="rename-button" :class="{ 'rename-button-dark': dark }" title="Rename file" @ok="confirmRename">
Expand Down
Loading