File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ import { TypeOfList } from '../utils/enums';
4444
4545async function openSettings() {
4646 await Browser .tabs .create ({
47- url: Browser .runtime .getURL (' settings.html' ),
47+ url: Browser .runtime .getURL (' src/ settings.html' ),
4848 active: true ,
4949 });
5050}
Original file line number Diff line number Diff line change 1010
1111 <div class =" content" >
1212 <label class =" setting-header" >
13- <input type =" checkbox" class =" filled-in" id =" viewTimeInBadge" />
13+ <input
14+ type =" checkbox"
15+ class =" filled-in"
16+ id =" viewTimeInBadge"
17+ v-model =" viewTimeInBadge"
18+ />
1419 <span >Display time tracker in icon</span >
1520 <p class =" description" >
1621 You can see current spent time in short format in the icon of extension
131136 </div >
132137</template >
133138
134- <script lang="ts" setup></script >
139+ <script lang="ts" setup>
140+ import { watchEffect , onMounted , ref } from ' vue' ;
141+ import { StorageParams } from ' ../storage/storage-params' ;
142+ import { injecStorage } from ' ../storage/inject-storage' ;
143+
144+ const settingsStorage = injecStorage ();
145+
146+ const viewTimeInBadge = ref <boolean >();
147+
148+ onMounted (async () => {
149+ viewTimeInBadge .value = await settingsStorage .getValue (StorageParams .VIEW_TIME_IN_BADGE );
150+ });
151+
152+ watchEffect (() => save (StorageParams .VIEW_TIME_IN_BADGE , viewTimeInBadge .value ));
153+
154+ function save(storageParam : StorageParams , value : any ) {
155+ settingsStorage .saveValue (storageParam , value );
156+ }
157+ </script >
135158
136159<style ></style >
You can’t perform that action at this time.
0 commit comments