diff --git a/src/auth/auth.composable.js b/src/auth/auth.composable.js
index 5451790..0f4c08f 100644
--- a/src/auth/auth.composable.js
+++ b/src/auth/auth.composable.js
@@ -51,7 +51,7 @@ export function useAuth() {
router.push("/access-denied");
return;
}
- callback();
+ callback?.();
}
/** Fetch JWT, store it and use it for API client. */
diff --git a/src/corpus/Corpus.vue b/src/corpus/Corpus.vue
index 9a99f2b..4f9886e 100644
--- a/src/corpus/Corpus.vue
+++ b/src/corpus/Corpus.vue
@@ -23,9 +23,11 @@
diff --git a/src/corpus/config/config.composable.js b/src/corpus/config/config.composable.js
index 5e599d7..dda45e9 100644
--- a/src/corpus/config/config.composable.js
+++ b/src/corpus/config/config.composable.js
@@ -9,8 +9,8 @@ export default function useConfig(corpusId) {
const { th } = useLocale();
const mink = useMinkBackend();
- const corpus = corpusStore.corpora[corpusId];
- const config = computed(() => corpus?.config);
+ const corpus = computed(() => corpusStore.corpora[corpusId]);
+ const config = computed(() => corpus.value?.config);
const corpusName = computed(() => th(config.value?.name));
async function loadConfig() {
@@ -21,7 +21,7 @@ export default function useConfig(corpusId) {
if (error.response?.status == 404) return emptyConfig();
throw error;
});
- corpus.config = config;
+ corpus.value.config = config;
}
async function uploadConfig(config, corpusId_ = corpusId) {
diff --git a/src/corpus/exports/exports.composable.js b/src/corpus/exports/exports.composable.js
index 1b88db2..3d5a13b 100644
--- a/src/corpus/exports/exports.composable.js
+++ b/src/corpus/exports/exports.composable.js
@@ -6,14 +6,14 @@ import useMessenger from "@/message/messenger.composable";
export default function useExports(corpusId) {
const corpusStore = useCorpusStore();
- const corpus = corpusStore.corpora[corpusId];
- const exports = computed(() => corpus?.exports);
+ const corpus = computed(() => corpusStore.corpora[corpusId]);
+ const exports = computed(() => corpus.value?.exports);
const mink = useMinkBackend();
const { alertError } = useMessenger();
async function loadExports() {
const exports = await mink.loadExports(corpusId).catch(alertError);
- corpus.exports = exports;
+ corpus.value.exports = exports;
}
async function downloadResult() {
diff --git a/src/corpus/job/job.composable.js b/src/corpus/job/job.composable.js
index db33ff3..1f6c8dc 100644
--- a/src/corpus/job/job.composable.js
+++ b/src/corpus/job/job.composable.js
@@ -49,23 +49,23 @@ class JobStatus {
export default function useJob(corpusId) {
const corpusStore = useCorpusStore();
- const corpus = corpusStore.corpora[corpusId];
+ const corpus = computed(() => corpusStore.corpora[corpusId]);
const mink = useMinkBackend();
const { alertError } = useMessenger();
async function loadJob() {
- corpus.status = await mink
+ corpus.value.status = await mink
.loadJob(corpusId)
.catch(() => ({}))
.catch(alertError);
}
async function runJob() {
- corpus.status = await mink.runJob(corpusId).catch(alertError);
+ corpus.value.status = await mink.runJob(corpusId).catch(alertError);
}
async function install() {
- corpus.status = await mink.install(corpusId).catch(alertError);
+ corpus.value.status = await mink.install(corpusId).catch(alertError);
}
async function abortJob() {
@@ -73,7 +73,7 @@ export default function useJob(corpusId) {
await loadJob();
}
- const jobStatus = computed(() => corpus?.status);
+ const jobStatus = computed(() => corpus.value?.status);
const sparvStatus = computed(
() => new JobStatus(jobStatus.value?.job_status?.sparv)
);
diff --git a/src/i18n/locale.composable.js b/src/i18n/locale.composable.js
index 9217157..5ece7aa 100644
--- a/src/i18n/locale.composable.js
+++ b/src/i18n/locale.composable.js
@@ -3,7 +3,7 @@ import { useI18n } from "vue-i18n";
import { useStorage } from "@vueuse/core";
import { filesize } from "filesize";
-const storedLocale = useStorage("locale");
+const storedLocale = useStorage("locale", "");
export default function useLocale() {
const { locale } = useI18n();