3434 </p >
3535 <ListWithTimeComponent :type =" ListWithTime.Notifications" />
3636 </div >
37+ <div class =" settings-item" >
38+ <label class =" setting-header" >Notification message</label >
39+ <p class =" description" >You will see this message in notification for websites every time</p >
40+ <input
41+ type =" text"
42+ class =" "
43+ placeholder =" Enter notification message name..."
44+ v-model =" notificationMessage"
45+ />
46+ <input
47+ type =" button"
48+ class =" d-inline-block small-btn ml-10 width"
49+ value =" Save"
50+ :disabled =" notificationMessage == ''"
51+ @click =" saveNotificationMessage()"
52+ />
53+ </div >
3754 </div >
3855</template >
3956
@@ -46,7 +63,7 @@ export default {
4663<script lang="ts" setup>
4764import { onMounted , ref } from ' vue' ;
4865import { injecStorage } from ' ../storage/inject-storage' ;
49- import { StorageParams } from ' ../storage/storage-params' ;
66+ import { NOTIFICATION_MESSAGE_DEFAULT , StorageParams } from ' ../storage/storage-params' ;
5067import {
5168 DAILY_NOTIFICATION_DEFAULT ,
5269 DAILY_SUMMARY_NOTIFICATION_TIME_DEFAULT ,
@@ -62,13 +79,19 @@ const settingsStorage = injecStorage();
6279const showDailyNotifacation = ref <boolean >();
6380const dailyNotificationTime = ref <number >();
6481const notificationTime = ref <Time >();
82+ const notificationMessage = ref <string >();
6583
6684onMounted (async () => {
6785 showDailyNotifacation .value = await settingsStorage .getValue (
6886 StorageParams .DAILY_NOTIFICATION ,
6987 DAILY_NOTIFICATION_DEFAULT ,
7088 );
7189
90+ notificationMessage .value = await settingsStorage .getValue (
91+ StorageParams .NOTIFICATION_MESSAGE ,
92+ NOTIFICATION_MESSAGE_DEFAULT ,
93+ );
94+
7295 dailyNotificationTime .value = (await settingsStorage .getValue (
7396 StorageParams .DAILY_SUMMARY_NOTIFICATION_TIME ,
7497 DAILY_SUMMARY_NOTIFICATION_TIME_DEFAULT ,
@@ -78,6 +101,10 @@ onMounted(async () => {
78101 notificationTime .value = timeObj ;
79102});
80103
104+ async function saveNotificationMessage() {
105+ save (StorageParams .NOTIFICATION_MESSAGE , notificationMessage .value );
106+ }
107+
81108async function handleDate(modelData : Time ) {
82109 if (modelData != null ) {
83110 notificationTime .value = modelData ;
@@ -103,4 +130,7 @@ async function save(storageParam: StorageParams, value: any) {
103130 width : 120px ;
104131 margin : 0 15px ;
105132}
133+ .width {
134+ width : 540px ;
135+ }
106136 </style >
0 commit comments