@ -184,7 +184,36 @@
< div class = "flex items-center justify-between" >
< div class = "flex items-center justify-between" >
<!-- label -- >
<!-- label -- >
< div >
< div >
New Activity Notifications
Reminder Notification
< fa
icon = "question-circle"
class = "text-slate-400 fa-fw ml-2 cursor-pointer"
@ click . stop = "showReminderNotificationInfo"
/ >
< / div >
<!-- toggle -- >
< div
class = "relative ml-2 cursor-pointer"
@ click = "showReminderNotificationChoice()"
>
<!-- input -- >
< input type = "checkbox" v -model = " notifyingReminder " class = "sr-only" / >
<!-- line -- >
< div class = "block bg-slate-500 w-14 h-8 rounded-full" > < / div >
<!-- dot -- >
< div
class = "dot absolute left-1 top-1 bg-slate-400 w-6 h-6 rounded-full transition"
> < / div >
< / div >
< / div >
< div v-if ="notifyingReminder" class="w-full flex justify-between" >
< span class = "ml-8 mr-8" > Message : "{{ notifyingReminderMessage }}" < / span >
< span > { { notifyingReminderTime . replace ( " " , " " ) } } < / span >
< / div >
< div class = "mt-2 flex items-center justify-between" >
<!-- label -- >
< div >
New Activity Notification
< fa
< fa
icon = "question-circle"
icon = "question-circle"
class = "text-slate-400 fa-fw ml-2 cursor-pointer"
class = "text-slate-400 fa-fw ml-2 cursor-pointer"
@ -200,7 +229,6 @@
< input
< input
type = "checkbox"
type = "checkbox"
v - model = "notifyingNewActivity"
v - model = "notifyingNewActivity"
name = "toggleNotificationsInput"
class = "sr-only"
class = "sr-only"
/ >
/ >
<!-- line -- >
<!-- line -- >
@ -212,7 +240,7 @@
< / div >
< / div >
< / div >
< / div >
< div v-if ="notifyingNewActivityTime" class="w-full text-right" >
< div v-if ="notifyingNewActivityTime" class="w-full text-right" >
{ { notifyingNewActivityTime } }
{ { notifyingNewActivityTime . replace ( " " , " " ) } }
< / div >
< / div >
< router -link class = "pl-4 text-sm text-blue-500" to = "/help-notifications" >
< router -link class = "pl-4 text-sm text-blue-500" to = "/help-notifications" >
Troubleshoot your notification setup .
Troubleshoot your notification setup .
@ -609,18 +637,51 @@
{ { DEFAULT_PUSH_SERVER } }
{ { DEFAULT_PUSH_SERVER } }
< / span >
< / span >
< h2 class = "text-slate-500 text-sm font-bold mb-2" > Partner Server URL < / h2 >
< div class = "px-3 py-4" >
< input
type = "text"
class = "block w-full rounded border border-slate-400 px-3 py-2"
v - model = "partnerApiServerInput"
/ >
< button
v - if = "partnerApiServerInput != partnerApiServer"
class = "w-full px-4 rounded bg-yellow-500 border border-slate-400"
@ click = "onClickSavePartnerServer()"
>
< fa icon = "floppy-disk" class = "fa-fw" color = "white" > < / fa >
< / button >
< button
class = "px-3 rounded bg-slate-200 border border-slate-400"
@ click = "partnerApiServerInput = AppConstants.PROD_PARTNER_API_SERVER"
>
Use Prod
< / button >
< button
class = "px-3 rounded bg-slate-200 border border-slate-400"
@ click = "partnerApiServerInput = AppConstants.TEST_PARTNER_API_SERVER"
>
Use Test
< / button >
< button
class = "px-3 rounded bg-slate-200 border border-slate-400"
@ click = "partnerApiServerInput = AppConstants.LOCAL_PARTNER_API_SERVER"
>
Use Local
< / button >
< / div >
< span class = "px-4 text-sm" v-if ="!partnerApiServerInput" >
When that setting is blank , this app will use the default partner server
URL :
{ { DEFAULT_PARTNER_API_SERVER } }
< / span >
< div id = "sectionImageServerURL" class = "mt-2" >
< div id = "sectionImageServerURL" class = "mt-2" >
< span class = "text-slate-500 text-sm font-bold" > Image Server URL < / span >
< span class = "text-slate-500 text-sm font-bold" > Image Server URL < / span >
& nbsp ;
& nbsp ;
< span class = "text-sm" > { { DEFAULT_IMAGE_API_SERVER } } < / span >
< span class = "text-sm" > { { DEFAULT_IMAGE_API_SERVER } } < / span >
< / div >
< / div >
< div id = "sectionPartnerServerURL" class = "mt-2" >
< span class = "text-slate-500 text-sm font-bold" > Partner Server URL < / span >
& nbsp ;
< span class = "text-sm" > { { DEFAULT_PARTNER_API_SERVER } } < / span >
< / div >
< label
< label
for = "toggleHideRegisterPromptOnNewContact"
for = "toggleHideRegisterPromptOnNewContact"
class = "flex items-center justify-between cursor-pointer mt-4"
class = "flex items-center justify-between cursor-pointer mt-4"
@ -778,7 +839,7 @@ import {
ImageRateLimits ,
ImageRateLimits ,
tokenExpiryTimeDescription ,
tokenExpiryTimeDescription ,
} from "@/libs/endorserServer" ;
} from "@/libs/endorserServer" ;
import { getAccount } from "@/libs/util" ;
import { DAILY_CHECK_TITLE , DIRECT_PUSH_TITLE , getAccount } from "@/libs/util" ;
const inputImportFileNameRef = ref < Blob > ( ) ;
const inputImportFileNameRef = ref < Blob > ( ) ;
@ -815,6 +876,11 @@ export default class AccountViewView extends Vue {
loadingLimits = false ;
loadingLimits = false ;
notifyingNewActivity = false ;
notifyingNewActivity = false ;
notifyingNewActivityTime = "" ;
notifyingNewActivityTime = "" ;
notifyingReminder = false ;
notifyingReminderMessage = "" ;
notifyingReminderTime = "" ;
partnerApiServer = "" ;
partnerApiServerInput = "" ;
passkeyExpirationDescription = "" ;
passkeyExpirationDescription = "" ;
passkeyExpirationMinutes = DEFAULT_PASSKEY_EXPIRATION_MINUTES ;
passkeyExpirationMinutes = DEFAULT_PASSKEY_EXPIRATION_MINUTES ;
previousPasskeyExpirationMinutes = DEFAULT_PASSKEY_EXPIRATION_MINUTES ;
previousPasskeyExpirationMinutes = DEFAULT_PASSKEY_EXPIRATION_MINUTES ;
@ -858,7 +924,7 @@ export default class AccountViewView extends Vue {
const registration = await navigator . serviceWorker ? . ready ;
const registration = await navigator . serviceWorker ? . ready ;
this . subscription = await registration . pushManager . getSubscription ( ) ;
this . subscription = await registration . pushManager . getSubscription ( ) ;
if ( ! this . subscription ) {
if ( ! this . subscription ) {
if ( this . notifyingNewActivity ) {
if ( this . notifyingNewActivity || this . notifyingReminder ) {
/ / t h e a p p t h o u g h t t h e r e w a s a s u b s c r i p t i o n b u t t h e r e i s n ' t , s o f i x t h e s e t t i n g s
/ / t h e a p p t h o u g h t t h e r e w a s a s u b s c r i p t i o n b u t t h e r e i s n ' t , s o f i x t h e s e t t i n g s
this . turnOffNotifyingFlags ( ) ;
this . turnOffNotifyingFlags ( ) ;
}
}
@ -909,14 +975,19 @@ export default class AccountViewView extends Vue {
this . givenName =
this . givenName =
( settings ? . firstName || "" ) +
( settings ? . firstName || "" ) +
( settings ? . lastName ? ` ${ settings . lastName } ` : "" ) ; / / p r e v 0 . 1 . 3
( settings ? . lastName ? ` ${ settings . lastName } ` : "" ) ; / / p r e v 0 . 1 . 3
this . hideRegisterPromptOnNewContact =
! ! settings . hideRegisterPromptOnNewContact ;
this . isRegistered = ! ! settings ? . isRegistered ;
this . isRegistered = ! ! settings ? . isRegistered ;
this . imageServer = settings . imageServer || "" ;
this . imageServer = settings . imageServer || "" ;
this . notifyingNewActivity = ! ! settings . notifyingNewActivityTime ;
this . notifyingNewActivityTime = settings . notifyingNewActivityTime || "" ;
this . notifyingReminder = ! ! settings . notifyingReminderTime ;
this . notifyingReminderMessage = settings . notifyingReminderMessage || "" ;
this . notifyingReminderTime = settings . notifyingReminderTime || "" ;
this . partnerApiServer = settings . partnerApiServer || "" ;
this . partnerApiServerInput = settings . partnerApiServer || "" ;
this . profileImageUrl = settings . profileImageUrl ;
this . profileImageUrl = settings . profileImageUrl ;
this . showContactGives = ! ! settings . showContactGivesInline ;
this . showContactGives = ! ! settings . showContactGivesInline ;
this . hideRegisterPromptOnNewContact =
! ! settings . hideRegisterPromptOnNewContact ;
this . notifyingNewActivity = ! ! settings . notifyingNewActivity ;
this . notifyingNewActivityTime = settings . notifyingNewActivityTime || "" ;
this . passkeyExpirationMinutes =
this . passkeyExpirationMinutes =
settings . passkeyExpirationMinutes ? ? DEFAULT_PASSKEY_EXPIRATION_MINUTES ;
settings . passkeyExpirationMinutes ? ? DEFAULT_PASSKEY_EXPIRATION_MINUTES ;
this . previousPasskeyExpirationMinutes = this . passkeyExpirationMinutes ;
this . previousPasskeyExpirationMinutes = this . passkeyExpirationMinutes ;
@ -1025,10 +1096,13 @@ export default class AccountViewView extends Vue {
if ( ! this . notifyingNewActivity ) {
if ( ! this . notifyingNewActivity ) {
(
(
this . $refs . pushNotificationPermission as PushNotificationPermission
this . $refs . pushNotificationPermission as PushNotificationPermission
) . open ( ( success : boolean , time : string ) => {
) . open ( DAILY_CHECK_TITLE , async ( success : boolean , timeText : string ) => {
if ( success ) {
if ( success ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingNewActivityTime : timeText ,
} ) ;
this . notifyingNewActivity = true ;
this . notifyingNewActivity = true ;
this . notifyingNewActivityTime = time ;
this . notifyingNewActivityTime = timeText ;
}
}
} ) ;
} ) ;
} else {
} else {
@ -1036,10 +1110,13 @@ export default class AccountViewView extends Vue {
{
{
group : "modal" ,
group : "modal" ,
type : "notification-off" ,
type : "notification-off" ,
title : "" , / / u n u s e d , o n l y h e r e t o s a t i s f y t y p e c h e c k
title : DAILY_CHECK_TITLE , / / r e p u r p o s e d t o i n d i c a t e t h e t y p e o f n o t i f i c a t i o n
text : "" , / / u n u s e d , o n l y h e r e t o s a t i s f y t y p e c h e c k
text : "" , / / u n u s e d , o n l y h e r e t o s a t i s f y t y p e c h e c k
callback : async ( success ) => {
callback : async ( success ) => {
if ( success ) {
if ( success ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingNewActivityTime : "" ,
} ) ;
this . notifyingNewActivity = false ;
this . notifyingNewActivity = false ;
this . notifyingNewActivityTime = "" ;
this . notifyingNewActivityTime = "" ;
}
}
@ -1050,6 +1127,71 @@ export default class AccountViewView extends Vue {
}
}
}
}
async showReminderNotificationInfo ( ) {
this . $notify (
{
group : "modal" ,
type : "confirm" ,
title : "Reminder Notification" ,
text : `
This will notify you at a specific time each day .
Note that it does not give you personalized notifications ,
so if you want less reliable but personalized notification then choose a 'New Activity' Notification .
Do you want more details ?
` ,
onYes : async ( ) => {
await ( this . $router as Router ) . push ( {
name : "help-notification-types" ,
} ) ;
} ,
yesText : "tell me more." ,
} ,
- 1 ,
) ;
}
async showReminderNotificationChoice ( ) {
if ( ! this . notifyingReminder ) {
(
this . $refs . pushNotificationPermission as PushNotificationPermission
) . open (
DIRECT_PUSH_TITLE ,
async ( success : boolean , timeText : string , message ? : string ) => {
if ( success ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingReminderMessage : message ,
notifyingReminderTime : timeText ,
} ) ;
this . notifyingReminder = true ;
this . notifyingReminderMessage = message || "" ;
this . notifyingReminderTime = timeText ;
}
} ,
) ;
} else {
this . $notify (
{
group : "modal" ,
type : "notification-off" ,
title : DIRECT_PUSH_TITLE , / / r e p u r p o s e d t o i n d i c a t e t h e t y p e o f n o t i f i c a t i o n
text : "" , / / u n u s e d , o n l y h e r e t o s a t i s f y t y p e c h e c k
callback : async ( success ) => {
if ( success ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingReminderMessage : "" ,
notifyingReminderTime : "" ,
} ) ;
this . notifyingReminder = false ;
this . notifyingReminderMessage = "" ;
this . notifyingReminderTime = "" ;
}
} ,
} ,
- 1 ,
) ;
}
}
public async toggleHideRegisterPromptOnNewContact ( ) {
public async toggleHideRegisterPromptOnNewContact ( ) {
const newSetting = ! this . hideRegisterPromptOnNewContact ;
const newSetting = ! this . hideRegisterPromptOnNewContact ;
await db . open ( ) ;
await db . open ( ) ;
@ -1069,13 +1211,18 @@ export default class AccountViewView extends Vue {
}
}
public async turnOffNotifyingFlags ( ) {
public async turnOffNotifyingFlags ( ) {
/ / s h o u l d t e l l t h e p u s h s e r v e r a s w e l l
await db . open ( ) ;
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingNewActivity : false ,
notifyingNewActivityTime : "" ,
notifyingNewActivityTime : "" ,
notifyingReminderMessage : "" ,
notifyingReminderTime : "" ,
} ) ;
} ) ;
this . notifyingNewActivity = false ;
this . notifyingNewActivity = false ;
this . notifyingNewActivityTime = "" ;
this . notifyingNewActivityTime = "" ;
this . notifyingReminder = false ;
this . notifyingReminderMessage = "" ;
this . notifyingReminderTime = "" ;
}
}
/ * *
/ * *
@ -1424,6 +1571,14 @@ export default class AccountViewView extends Vue {
this . apiServer = this . apiServerInput ;
this . apiServer = this . apiServerInput ;
}
}
async onClickSavePartnerServer ( ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
partnerApiServer : this . partnerApiServerInput ,
} ) ;
this . partnerApiServer = this . partnerApiServerInput ;
}
async onClickSavePushServer ( ) {
async onClickSavePushServer ( ) {
await db . open ( ) ;
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
await db . settings . update ( MASTER_SETTINGS_KEY , {