Skip to content

Commit 1e7611c

Browse files
committed
fix(web): disable simkl for web
1 parent 4cbea70 commit 1e7611c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/views/settings/SettingsConnect.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ useWatchActivated(
7171
<template>
7272
<NFlex align="center">
7373
<SettingsFormItem :label="i18n('label_enable')" class="flex-auto">
74-
<NSwitch v-model:value="simklEnabled" class="form-switch">
74+
<NSwitch
75+
v-model:value="simklEnabled"
76+
:disabled="!chromeRuntimeId"
77+
class="form-switch"
78+
>
7579
<template #checked>{{ i18n('on', 'common', 'button') }}</template>
7680
<template #unchecked>{{ i18n('off', 'common', 'button') }}</template>
7781
</NSwitch>

src/stores/data/simkl.store.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { chromeRuntimeId } from '@dvcol/web-extension-utils/chrome/runtime';
12
import { defineStore, storeToRefs } from 'pinia';
23

34
import { computed, reactive } from 'vue';
@@ -188,7 +189,7 @@ export const useSimklStore = defineStore(SimklStoreConstants.Store, () => {
188189
setUserSetting,
189190
simklAllowed,
190191
simklEnabled: computed({
191-
get: () => simklAllowed.value && userEnabled.value,
192+
get: () => simklAllowed.value && userEnabled.value && !!chromeRuntimeId,
192193
set: (value: boolean) => setUserEnabled(value),
193194
}),
194195
initSimklStore,

0 commit comments

Comments
 (0)