@ -1151,7 +1151,7 @@ export default class AccountViewView extends Vue {
databaseUtil . logConsoleAndDb (
"Error loading profile: " + errorStringForLog ( error ) ,
) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
logConsoleAndDb (
"Error loading profile: " + errorStringForLog ( error ) ,
) ;
@ -1282,7 +1282,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
showContactGivesInline : this . showContactGives ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
showContactGivesInline : this . showContactGives ,
@ -1295,7 +1295,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
showGeneralAdvanced : this . showGeneralAdvanced ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
showGeneralAdvanced : this . showGeneralAdvanced ,
@ -1308,7 +1308,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
warnIfProdServer : this . warnIfProdServer ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
warnIfProdServer : this . warnIfProdServer ,
@ -1321,7 +1321,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
warnIfTestServer : this . warnIfTestServer ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
warnIfTestServer : this . warnIfTestServer ,
@ -1334,7 +1334,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
showShortcutBvc : this . showShortcutBvc ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
showShortcutBvc : this . showShortcutBvc ,
@ -1351,15 +1351,19 @@ export default class AccountViewView extends Vue {
* /
async processIdentity ( ) {
const platformService = PlatformServiceFactory . getInstance ( ) ;
const dbAccount = await platformService . dbQuery ( "SELECT * FROM accounts WHERE did = ?" , [ this . activeDid ] ) ;
const dbAccount = await platformService . dbQuery (
"SELECT * FROM accounts WHERE did = ?" ,
[ this . activeDid ] ,
) ;
let account : Account | undefined = undefined ;
if ( dbAccount ) {
account = databaseUtil . mapColumnsToValues ( dbAccount . columns , dbAccount . values ) [ 0 ] as Account ;
account = databaseUtil . mapColumnsToValues (
dbAccount . columns ,
dbAccount . values ,
) [ 0 ] as Account ;
}
if ( USE_DEXIE_DB ) {
account = await retrieveAccountMetadata (
this . activeDid ,
) ;
account = await retrieveAccountMetadata ( this . activeDid ) ;
}
if ( account ? . identity ) {
const identity = JSON . parse ( account . identity as string ) as IIdentifier ;
@ -1406,7 +1410,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
notifyingNewActivityTime : timeText ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingNewActivityTime : timeText ,
} ) ;
@ -1427,7 +1431,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
notifyingNewActivityTime : "" ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingNewActivityTime : "" ,
} ) ;
@ -1477,7 +1481,7 @@ export default class AccountViewView extends Vue {
notifyingReminderMessage : message ,
notifyingReminderTime : timeText ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingReminderMessage : message ,
notifyingReminderTime : timeText ,
@ -1502,7 +1506,7 @@ export default class AccountViewView extends Vue {
notifyingReminderMessage : "" ,
notifyingReminderTime : "" ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingReminderMessage : "" ,
notifyingReminderTime : "" ,
@ -1524,7 +1528,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
hideRegisterPromptOnNewContact : newSetting ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
hideRegisterPromptOnNewContact : newSetting ,
@ -1537,7 +1541,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
passkeyExpirationMinutes : this . passkeyExpirationMinutes ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
passkeyExpirationMinutes : this . passkeyExpirationMinutes ,
@ -1554,7 +1558,7 @@ export default class AccountViewView extends Vue {
notifyingReminderMessage : "" ,
notifyingReminderTime : "" ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
notifyingNewActivityTime : "" ,
@ -1708,25 +1712,25 @@ export default class AccountViewView extends Vue {
if ( inputImportFileNameRef . value != null ) {
if ( USE_DEXIE_DB ) {
await db
. delete ( )
. then ( async ( ) => {
/ / B u l k E r r o r : s e t t i n g s . b u l k A d d ( ) : 1 o f 2 1 o p e r a t i o n s f a i l e d . E r r o r s : C o n s t r a i n t E r r o r : K e y a l r e a d y e x i s t s i n t h e o b j e c t s t o r e .
await Dexie . import ( inputImportFileNameRef . value as Blob , {
progressCallback : this . progressCallback ,
. delete ( )
. then ( async ( ) => {
/ / B u l k E r r o r : s e t t i n g s . b u l k A d d ( ) : 1 o f 2 1 o p e r a t i o n s f a i l e d . E r r o r s : C o n s t r a i n t E r r o r : K e y a l r e a d y e x i s t s i n t h e o b j e c t s t o r e .
await Dexie . import ( inputImportFileNameRef . value as Blob , {
progressCallback : this . progressCallback ,
} ) ;
} )
. catch ( ( error ) => {
logger . error ( "Error importing file:" , error ) ;
this . $notify (
{
group : "alert" ,
type : "danger" ,
title : "Error Importing" ,
text : "There was an error in the import. Your identities and contacts may have been affected, so you may have to restore your identifier and use the contact import method." ,
} ,
- 1 ,
) ;
} ) ;
} )
. catch ( ( error ) => {
logger . error ( "Error importing file:" , error ) ;
this . $notify (
{
group : "alert" ,
type : "danger" ,
title : "Error Importing" ,
text : "There was an error in the import. Your identities and contacts may have been affected, so you may have to restore your identifier and use the contact import method." ,
} ,
- 1 ,
) ;
} ) ;
} else {
throw new Error ( "Not implemented" ) ;
}
@ -1817,8 +1821,10 @@ export default class AccountViewView extends Vue {
if ( ! this . isRegistered ) {
/ / t h e u s e r w a s n o t k n o w n t o b e r e g i s t e r e d , b u t n o w t h e y a r e ( b e c a u s e w e g o t n o e r r o r ) s o l e t ' s r e c o r d i t
try {
await databaseUtil . updateAccountSettings ( did , { isRegistered : true } ) ;
if ( USE_DEXIE_DB ) {
await databaseUtil . updateAccountSettings ( did , {
isRegistered : true ,
} ) ;
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
isRegistered : true ,
@ -1886,7 +1892,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
apiServer : this . apiServerInput ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
apiServer : this . apiServerInput ,
@ -1899,7 +1905,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
partnerApiServer : this . partnerApiServerInput ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
partnerApiServer : this . partnerApiServerInput ,
@ -1912,7 +1918,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
webPushServer : this . webPushServerInput ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
webPushServer : this . webPushServerInput ,
@ -1936,8 +1942,8 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
profileImageUrl : imgUrl ,
} ) ;
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
profileImageUrl : imgUrl ,
} ) ;
@ -2005,7 +2011,7 @@ export default class AccountViewView extends Vue {
await databaseUtil . updateDefaultSettings ( {
profileImageUrl : undefined ,
} ) ;
if ( USE_DEXIE_DB ) {
if ( USE_DEXIE_DB ) {
await db . open ( ) ;
await db . settings . update ( MASTER_SETTINGS_KEY , {
profileImageUrl : undefined ,
@ -2099,8 +2105,10 @@ export default class AccountViewView extends Vue {
throw Error ( "Profile not saved" ) ;
}
} catch ( error ) {
databaseUtil . logConsoleAndDb ( "Error saving profile: " + errorStringForLog ( error ) ) ;
if ( USE_DEXIE_DB ) {
databaseUtil . logConsoleAndDb (
"Error saving profile: " + errorStringForLog ( error ) ,
) ;
if ( USE_DEXIE_DB ) {
logConsoleAndDb ( "Error saving profile: " + errorStringForLog ( error ) ) ;
}
const errorMessage : string =
@ -2192,8 +2200,10 @@ export default class AccountViewView extends Vue {
throw Error ( "Profile not deleted" ) ;
}
} catch ( error ) {
databaseUtil . logConsoleAndDb ( "Error deleting profile: " + errorStringForLog ( error ) ) ;
if ( USE_DEXIE_DB ) {
databaseUtil . logConsoleAndDb (
"Error deleting profile: " + errorStringForLog ( error ) ,
) ;
if ( USE_DEXIE_DB ) {
logConsoleAndDb ( "Error deleting profile: " + errorStringForLog ( error ) ) ;
}
const errorMessage : string =