A simple to-do app focused on tasks that can be completed within a specific time span.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

changes

+45 -55
+39
app/components/Settings/SettingsSheet.vue
··· 23 23 } else { 24 24 console.error("Unknown locale"); 25 25 } 26 + } 27 + 28 + async function sendPush() { 29 + const permission = await Notification.requestPermission(); 30 + 31 + if (permission !== "granted") return; 32 + 33 + const reg = await navigator.serviceWorker.ready; 34 + 35 + const sub = await reg.pushManager.subscribe({ 36 + userVisibleOnly: true, 37 + applicationServerKey: 38 + process.env.SUBSCRIPTIONS_PUBLIC_KEY, 39 + }); 40 + 41 + const fetch = useRequestFetch(); 42 + 43 + const response = await fetch(`/api/subscription/`, { 44 + method: "POST", 45 + body: sub.toJSON(), 46 + ...useFetchOptions(), 47 + }).catch(async (err) => { 48 + //todo - show in toast 49 + console.warn(err); 50 + // await this.fetch(); 51 + }); 52 + 53 + console.log(response); 26 54 } 27 55 </script> 28 56 ··· 60 88 <option value="top">{{ t(`top`) }}</option> 61 89 <option value="bottom">{{ t(`bottom`) }}</option> 62 90 </select> 91 + </div> 92 + 93 + <div> 94 + <h2 class="text-muted-text text-lg">{{ t("push") }}</h2> 95 + <button 96 + data-testid="add-label-button" 97 + class="bg-surface border-secondary h-8 cursor-pointer rounded border px-2 text-white" 98 + @click="sendPush()" 99 + > 100 + {{ t("push") }} 101 + </button> 63 102 </div> 64 103 </div> 65 104 <Categories />
-51
app/pages/index.vue
··· 38 38 } 39 39 } 40 40 }); 41 - 42 - async function send() { 43 - const permission = await Notification.requestPermission(); 44 - 45 - if (permission !== "granted") return; 46 - 47 - const reg = await navigator.serviceWorker.ready; 48 - 49 - const sub = await reg.pushManager.subscribe({ 50 - userVisibleOnly: true, 51 - applicationServerKey: 52 - "BKkvpMKOQ3wvNUpoohpuZmTUCNe8rH4bZwCbTeLW16F1ZeUm9DDEavdpXOfXIR6PWZpPswiCYte1KMveWMFvslY", 53 - }); 54 - 55 - const fetch = useRequestFetch(); 56 - 57 - const response = await fetch(`/api/subscription/`, { 58 - method: "POST", 59 - body: sub.toJSON(), 60 - ...useFetchOptions(), 61 - }).catch(async (err) => { 62 - //todo - show in toast 63 - console.warn(err); 64 - // await this.fetch(); 65 - }); 66 - 67 - console.log(response); 68 - } 69 - 70 - async function msg() { 71 - const fetch = useRequestFetch(); 72 - 73 - await fetch(`/api/subscription/sendNotification`, { 74 - method: "POST", 75 - ...useFetchOptions(), 76 - }).catch(async (err) => { 77 - //todo - show in toast 78 - console.warn(err); 79 - // await this.fetch(); 80 - }); 81 - } 82 41 </script> 83 42 <template> 84 43 <div> ··· 86 45 <SettingsSheet v-model:is-open="isSettingsSheetOpen" /> 87 46 <EditTodoSheet /> 88 47 <NewTodoSheet v-model:is-open="isNewSheetOpen" /> 89 - 90 - <div> 91 - <h1>testing begin</h1> 92 - 93 - <button type="button" @click="send()">send</button> 94 - <br> 95 - <button type="button" @click="msg()">message</button> 96 - 97 - <h1>testing end</h1> 98 - </div> 99 48 100 49 <div v-if="!isMobile"> 101 50 <SplitterGroup direction="horizontal">
+2 -1
i18n/locales/de.json
··· 30 30 "date-point": "Zeitpunkt", 31 31 "recurring-none": "Keine", 32 32 "recurring-daily": "Täglich", 33 - "recurring-weekly": "Wöchentlich" 33 + "recurring-weekly": "Wöchentlich", 34 + "push": "Webpush" 34 35 }
+2 -1
i18n/locales/en.json
··· 30 30 "date-point": "Date Point", 31 31 "recurring-none": "None", 32 32 "recurring-daily": "Daily", 33 - "recurring-weekly": "Weekly" 33 + "recurring-weekly": "Weekly", 34 + "push": "Webpush" 34 35 }
+2 -2
server/utils/db/subscription.ts
··· 8 8 9 9 webpush.setVapidDetails( 10 10 "mailto:you@example.com", 11 - "BKkvpMKOQ3wvNUpoohpuZmTUCNe8rH4bZwCbTeLW16F1ZeUm9DDEavdpXOfXIR6PWZpPswiCYte1KMveWMFvslY", 12 - "wGiryLM_sL1fRZfWhcYeJ_ZgSucqtOn1S_A60lBThnc", 11 + process.env.SUBSCRIPTIONS_PUBLIC_KEY, 12 + process.env.SUBSCRIPTIONS_PRIVATE_KEY, 13 13 ); 14 14 15 15 export const Subscriptions = {