diff --git a/extension/src/stores/settings.js b/extension/src/stores/settings.js index a915f8d..aed28c4 100644 --- a/extension/src/stores/settings.js +++ b/extension/src/stores/settings.js @@ -2,9 +2,11 @@ import { ref, watch } from 'vue' import { defineStore } from 'pinia' import { editors } from '../configs/editors' +const defaultEditor = editors[0].id; + export const useSettingsStore = defineStore('settings', () => { - const filepathLinkBehaviour = ref(localStorage.getItem('railspanel.filepathLinkBehaviour') || 'open'); - const editor = ref(editors.find((e) => e.id == (localStorage.getItem('railspanel.editor') || editors[0].id))); + const filepathLinkBehaviour = ref(localStorage.getItem('railspanel.filepathLinkBehaviour') || 'copy'); + const editor = ref(editors.find((e) => e.id == (localStorage.getItem('railspanel.editor') || defaultEditor)) || defaultEditor); watch(editor, (newVal, oldVal) => { localStorage.setItem('railspanel.editor', newVal.id);