fix: move lexical declarations outside case blocks in AbsurdSqlDatabaseService
- Move queryResult and allResult declarations outside switch statement - Change const declarations to let since they're now in outer scope - Remove const declarations from inside case blocks This fixes the 'no-case-declarations' linter errors by ensuring variables are declared in a scope that encompasses all case blocks, preventing potential scoping issues. Note: Type definition errors for external modules remain and should be addressed separately.
This commit is contained in:
3032
package-lock.json
generated
3032
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,12 @@ export async function updateDefaultSettings(
|
||||
delete settingsChanges.id;
|
||||
try {
|
||||
const platformService = PlatformServiceFactory.getInstance();
|
||||
const { sql, params } = generateUpdateStatement(settingsChanges, "settings", "id = ?", [MASTER_SETTINGS_KEY]);
|
||||
const { sql, params } = generateUpdateStatement(
|
||||
settingsChanges,
|
||||
"settings",
|
||||
"id = ?",
|
||||
[MASTER_SETTINGS_KEY],
|
||||
);
|
||||
const result = await platformService.dbExec(sql, params);
|
||||
return result.changes === 1;
|
||||
} catch (error) {
|
||||
@@ -40,7 +45,7 @@ export async function updateAccountSettings(
|
||||
settingsChanges,
|
||||
"settings",
|
||||
"accountDid = ?",
|
||||
[accountDid]
|
||||
[accountDid],
|
||||
);
|
||||
|
||||
const updateResult = await platform.dbExec(updateSql, updateParams);
|
||||
@@ -51,9 +56,9 @@ export async function updateAccountSettings(
|
||||
} else {
|
||||
const columns = Object.keys(settingsChanges);
|
||||
const values = Object.values(settingsChanges);
|
||||
const placeholders = values.map(() => '?').join(', ');
|
||||
const placeholders = values.map(() => "?").join(", ");
|
||||
|
||||
const insertSql = `INSERT INTO settings (${columns.join(', ')}) VALUES (${placeholders})`;
|
||||
const insertSql = `INSERT INTO settings (${columns.join(", ")}) VALUES (${placeholders})`;
|
||||
const result = await platform.dbExec(insertSql, values);
|
||||
|
||||
return result.changes === 1;
|
||||
@@ -69,7 +74,9 @@ const DEFAULT_SETTINGS: Settings = {
|
||||
// retrieves default settings
|
||||
export async function retrieveSettingsForDefaultAccount(): Promise<Settings> {
|
||||
const platform = PlatformServiceFactory.getInstance();
|
||||
const result = await platform.dbQuery("SELECT * FROM settings WHERE id = ?", [MASTER_SETTINGS_KEY])
|
||||
const result = await platform.dbQuery("SELECT * FROM settings WHERE id = ?", [
|
||||
MASTER_SETTINGS_KEY,
|
||||
]);
|
||||
if (!result) {
|
||||
return DEFAULT_SETTINGS;
|
||||
} else {
|
||||
@@ -85,10 +92,14 @@ export async function retrieveSettingsForActiveAccount(): Promise<Settings> {
|
||||
const platform = PlatformServiceFactory.getInstance();
|
||||
const result = await platform.dbQuery(
|
||||
"SELECT * FROM settings WHERE accountDid = ?",
|
||||
[defaultSettings.activeDid]
|
||||
[defaultSettings.activeDid],
|
||||
);
|
||||
const overrideSettings = result
|
||||
? (mapColumnsToValues(result.columns, result.values)[0] as Settings)
|
||||
: {};
|
||||
const overrideSettingsFiltered = Object.fromEntries(
|
||||
Object.entries(overrideSettings).filter(([_, v]) => v !== null),
|
||||
);
|
||||
const overrideSettings = result ? mapColumnsToValues(result.columns, result.values)[0] as Settings : {};
|
||||
const overrideSettingsFiltered = Object.fromEntries(Object.entries(overrideSettings).filter(([_, v]) => v !== null));
|
||||
return { ...defaultSettings, ...overrideSettingsFiltered };
|
||||
}
|
||||
}
|
||||
@@ -100,7 +111,7 @@ export async function logToDb(message: string): Promise<void> {
|
||||
// Check if we have any logs for today
|
||||
const result = await platform.dbQuery(
|
||||
"SELECT message FROM logs WHERE date = ?",
|
||||
[todayKey]
|
||||
[todayKey],
|
||||
);
|
||||
|
||||
if (!result || result.values.length === 0) {
|
||||
@@ -109,19 +120,19 @@ export async function logToDb(message: string): Promise<void> {
|
||||
|
||||
// Insert new log
|
||||
const fullMessage = `${new Date().toISOString()} ${message}`;
|
||||
await platform.dbExec(
|
||||
"INSERT INTO logs (date, message) VALUES (?, ?)",
|
||||
[todayKey, fullMessage]
|
||||
);
|
||||
await platform.dbExec("INSERT INTO logs (date, message) VALUES (?, ?)", [
|
||||
todayKey,
|
||||
fullMessage,
|
||||
]);
|
||||
} else {
|
||||
// Append to existing log
|
||||
const prevMessages = result.values[0][0] as string;
|
||||
const fullMessage = `${prevMessages}\n${new Date().toISOString()} ${message}`;
|
||||
|
||||
await platform.dbExec(
|
||||
"UPDATE logs SET message = ? WHERE date = ?",
|
||||
[fullMessage, todayKey]
|
||||
);
|
||||
await platform.dbExec("UPDATE logs SET message = ? WHERE date = ?", [
|
||||
fullMessage,
|
||||
todayKey,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,14 +158,14 @@ export async function logConsoleAndDb(
|
||||
* @returns Object containing the SQL statement and parameters array
|
||||
*/
|
||||
function generateUpdateStatement(
|
||||
model: Record<string, any>,
|
||||
model: Record<string, unknown>,
|
||||
tableName: string,
|
||||
whereClause: string,
|
||||
whereParams: any[] = []
|
||||
): { sql: string; params: any[] } {
|
||||
whereParams: unknown[] = [],
|
||||
): { sql: string; params: unknown[] } {
|
||||
// Filter out undefined/null values and create SET clause
|
||||
const setClauses: string[] = [];
|
||||
const params: any[] = [];
|
||||
const params: unknown[] = [];
|
||||
|
||||
Object.entries(model).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
@@ -164,14 +175,14 @@ function generateUpdateStatement(
|
||||
});
|
||||
|
||||
if (setClauses.length === 0) {
|
||||
throw new Error('No valid fields to update');
|
||||
throw new Error("No valid fields to update");
|
||||
}
|
||||
|
||||
const sql = `UPDATE ${tableName} SET ${setClauses.join(', ')} WHERE ${whereClause}`;
|
||||
const sql = `UPDATE ${tableName} SET ${setClauses.join(", ")} WHERE ${whereClause}`;
|
||||
|
||||
return {
|
||||
sql,
|
||||
params: [...params, ...whereParams]
|
||||
params: [...params, ...whereParams],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -184,14 +195,13 @@ function generateUpdateStatement(
|
||||
*/
|
||||
export function mapColumnsToValues(
|
||||
columns: string[],
|
||||
values: any[][]
|
||||
): Record<string, any>[] {
|
||||
return values.map(row => {
|
||||
const obj: Record<string, any> = {};
|
||||
values: unknown[][],
|
||||
): Record<string, unknown>[] {
|
||||
return values.map((row) => {
|
||||
const obj: Record<string, unknown> = {};
|
||||
columns.forEach((column, index) => {
|
||||
obj[column] = row[index];
|
||||
});
|
||||
return obj;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -312,23 +312,29 @@ export async function testMessageEncryptionDecryption() {
|
||||
}
|
||||
|
||||
// Simple encryption/decryption using Node's crypto
|
||||
export async function simpleEncrypt(text: string, secret: string): Promise<string> {
|
||||
export async function simpleEncrypt(
|
||||
text: string,
|
||||
secret: string,
|
||||
): Promise<string> {
|
||||
const iv = crypto.getRandomValues(new Uint8Array(16));
|
||||
|
||||
// Derive a 256-bit key from the secret using SHA-256
|
||||
const keyData = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(secret));
|
||||
const keyData = await crypto.subtle.digest(
|
||||
"SHA-256",
|
||||
new TextEncoder().encode(secret),
|
||||
);
|
||||
const key = await crypto.subtle.importKey(
|
||||
'raw',
|
||||
"raw",
|
||||
keyData,
|
||||
{ name: 'AES-GCM' },
|
||||
{ name: "AES-GCM" },
|
||||
false,
|
||||
['encrypt']
|
||||
["encrypt"],
|
||||
);
|
||||
|
||||
const encrypted = await crypto.subtle.encrypt(
|
||||
{ name: 'AES-GCM', iv },
|
||||
{ name: "AES-GCM", iv },
|
||||
key,
|
||||
new TextEncoder().encode(text)
|
||||
new TextEncoder().encode(text),
|
||||
);
|
||||
|
||||
// Combine IV and encrypted data
|
||||
@@ -339,27 +345,33 @@ export async function simpleEncrypt(text: string, secret: string): Promise<strin
|
||||
return btoa(String.fromCharCode(...result));
|
||||
}
|
||||
|
||||
export async function simpleDecrypt(encryptedText: string, secret: string): Promise<string> {
|
||||
const data = Uint8Array.from(atob(encryptedText), c => c.charCodeAt(0));
|
||||
export async function simpleDecrypt(
|
||||
encryptedText: string,
|
||||
secret: string,
|
||||
): Promise<string> {
|
||||
const data = Uint8Array.from(atob(encryptedText), (c) => c.charCodeAt(0));
|
||||
|
||||
// Extract IV and encrypted data
|
||||
const iv = data.slice(0, 16);
|
||||
const encrypted = data.slice(16);
|
||||
|
||||
// Derive the same 256-bit key from the secret using SHA-256
|
||||
const keyData = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(secret));
|
||||
const keyData = await crypto.subtle.digest(
|
||||
"SHA-256",
|
||||
new TextEncoder().encode(secret),
|
||||
);
|
||||
const key = await crypto.subtle.importKey(
|
||||
'raw',
|
||||
"raw",
|
||||
keyData,
|
||||
{ name: 'AES-GCM' },
|
||||
{ name: "AES-GCM" },
|
||||
false,
|
||||
['decrypt']
|
||||
["decrypt"],
|
||||
);
|
||||
|
||||
const decrypted = await crypto.subtle.decrypt(
|
||||
{ name: 'AES-GCM', iv },
|
||||
{ name: "AES-GCM", iv },
|
||||
key,
|
||||
encrypted
|
||||
encrypted,
|
||||
);
|
||||
|
||||
return new TextDecoder().decode(decrypted);
|
||||
|
||||
@@ -5,7 +5,11 @@ import { Buffer } from "buffer";
|
||||
import * as R from "ramda";
|
||||
import { useClipboard } from "@vueuse/core";
|
||||
|
||||
import { DEFAULT_PUSH_SERVER, NotificationIface, USE_DEXIE_DB } from "../constants/app";
|
||||
import {
|
||||
DEFAULT_PUSH_SERVER,
|
||||
NotificationIface,
|
||||
USE_DEXIE_DB,
|
||||
} from "../constants/app";
|
||||
import {
|
||||
accountsDBPromise,
|
||||
retrieveSettingsForActiveAccount,
|
||||
|
||||
@@ -20,11 +20,11 @@ interface AbsurdSqlDatabase {
|
||||
}
|
||||
|
||||
interface QueuedOperation {
|
||||
type: 'run' | 'query' | 'getOneRow' | 'getAll';
|
||||
type: "run" | "query" | "getOneRow" | "getAll";
|
||||
sql: string;
|
||||
params: unknown[];
|
||||
resolve: (value: any) => void;
|
||||
reject: (reason: any) => void;
|
||||
resolve: (value: unknown) => void;
|
||||
reject: (reason: unknown) => void;
|
||||
}
|
||||
|
||||
class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
@@ -129,19 +129,21 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
|
||||
try {
|
||||
let result;
|
||||
let queryResult;
|
||||
let allResult;
|
||||
switch (operation.type) {
|
||||
case 'run':
|
||||
case "run":
|
||||
result = await this.db.run(operation.sql, operation.params);
|
||||
break;
|
||||
case 'query':
|
||||
case "query":
|
||||
result = await this.db.exec(operation.sql, operation.params);
|
||||
break;
|
||||
case 'getOneRow':
|
||||
const queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
case "getOneRow":
|
||||
queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
result = queryResult[0]?.values[0];
|
||||
break;
|
||||
case 'getAll':
|
||||
const allResult = await this.db.exec(operation.sql, operation.params);
|
||||
case "getAll":
|
||||
allResult = await this.db.exec(operation.sql, operation.params);
|
||||
result = allResult[0]?.values || [];
|
||||
break;
|
||||
}
|
||||
@@ -155,7 +157,7 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
}
|
||||
|
||||
private async queueOperation<T>(
|
||||
type: QueuedOperation['type'],
|
||||
type: QueuedOperation["type"],
|
||||
sql: string,
|
||||
params: unknown[] = [],
|
||||
): Promise<T> {
|
||||
@@ -205,13 +207,17 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
params: unknown[] = [],
|
||||
): Promise<{ changes: number; lastId?: number }> {
|
||||
await this.waitForInitialization();
|
||||
return this.queueOperation<{ changes: number; lastId?: number }>('run', sql, params);
|
||||
return this.queueOperation<{ changes: number; lastId?: number }>(
|
||||
"run",
|
||||
sql,
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
// Note that the resulting array may be empty if there are no results from the query
|
||||
async query(sql: string, params: unknown[] = []): Promise<QueryExecResult[]> {
|
||||
await this.waitForInitialization();
|
||||
return this.queueOperation<QueryExecResult[]>('query', sql, params);
|
||||
return this.queueOperation<QueryExecResult[]>("query", sql, params);
|
||||
}
|
||||
|
||||
async getOneRow(
|
||||
@@ -219,12 +225,12 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
params: unknown[] = [],
|
||||
): Promise<unknown[] | undefined> {
|
||||
await this.waitForInitialization();
|
||||
return this.queueOperation<unknown[] | undefined>('getOneRow', sql, params);
|
||||
return this.queueOperation<unknown[] | undefined>("getOneRow", sql, params);
|
||||
}
|
||||
|
||||
async getAll(sql: string, params: unknown[] = []): Promise<unknown[][]> {
|
||||
await this.waitForInitialization();
|
||||
return this.queueOperation<unknown[][]>('getAll', sql, params);
|
||||
return this.queueOperation<unknown[][]>("getAll", sql, params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,5 +115,8 @@ export interface PlatformService {
|
||||
* @param params - The parameters to pass to the statement
|
||||
* @returns Promise resolving to the result of the statement
|
||||
*/
|
||||
dbExec(sql: string, params?: unknown[]): Promise<{ changes: number; lastId?: number }>;
|
||||
dbExec(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<{ changes: number; lastId?: number }>;
|
||||
}
|
||||
|
||||
@@ -481,7 +481,10 @@ export class CapacitorPlatformService implements PlatformService {
|
||||
dbQuery(sql: string, params?: unknown[]): Promise<QueryExecResult> {
|
||||
throw new Error("Not implemented for " + sql + " with params " + params);
|
||||
}
|
||||
dbExec(sql: string, params?: unknown[]): Promise<{ changes: number; lastId?: number }> {
|
||||
dbExec(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<{ changes: number; lastId?: number }> {
|
||||
throw new Error("Not implemented for " + sql + " with params " + params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,10 @@ export class ElectronPlatformService implements PlatformService {
|
||||
dbQuery(sql: string, params?: unknown[]): Promise<QueryExecResult> {
|
||||
throw new Error("Not implemented for " + sql + " with params " + params);
|
||||
}
|
||||
dbExec(sql: string, params?: unknown[]): Promise<{ changes: number; lastId?: number }> {
|
||||
dbExec(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<{ changes: number; lastId?: number }> {
|
||||
throw new Error("Not implemented for " + sql + " with params " + params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,10 @@ export class PyWebViewPlatformService implements PlatformService {
|
||||
dbQuery(sql: string, params?: unknown[]): Promise<QueryExecResult> {
|
||||
throw new Error("Not implemented for " + sql + " with params " + params);
|
||||
}
|
||||
dbExec(sql: string, params?: unknown[]): Promise<{ changes: number; lastId?: number }> {
|
||||
dbExec(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<{ changes: number; lastId?: number }> {
|
||||
throw new Error("Not implemented for " + sql + " with params " + params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +372,10 @@ export class WebPlatformService implements PlatformService {
|
||||
/**
|
||||
* @see PlatformService.dbExec
|
||||
*/
|
||||
dbExec(sql: string, params?: unknown[]): Promise<{ changes: number; lastId?: number }> {
|
||||
dbExec(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<{ changes: number; lastId?: number }> {
|
||||
return databaseService.run(sql, params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ const crypto = {
|
||||
},
|
||||
createHash: () => ({
|
||||
update: () => ({
|
||||
digest: () => new Uint8Array(32) // Return empty hash
|
||||
})
|
||||
})
|
||||
digest: () => new Uint8Array(32), // Return empty hash
|
||||
}),
|
||||
}),
|
||||
};
|
||||
|
||||
export default crypto;
|
||||
@@ -1,18 +1,18 @@
|
||||
// Minimal fs module implementation for browser
|
||||
const fs = {
|
||||
readFileSync: () => {
|
||||
throw new Error('fs.readFileSync is not supported in browser');
|
||||
throw new Error("fs.readFileSync is not supported in browser");
|
||||
},
|
||||
writeFileSync: () => {
|
||||
throw new Error('fs.writeFileSync is not supported in browser');
|
||||
throw new Error("fs.writeFileSync is not supported in browser");
|
||||
},
|
||||
existsSync: () => false,
|
||||
mkdirSync: () => {},
|
||||
readdirSync: () => [],
|
||||
statSync: () => ({
|
||||
isDirectory: () => false,
|
||||
isFile: () => false
|
||||
})
|
||||
isFile: () => false,
|
||||
}),
|
||||
};
|
||||
|
||||
export default fs;
|
||||
@@ -1,13 +1,13 @@
|
||||
// Minimal path module implementation for browser
|
||||
const path = {
|
||||
resolve: (...parts) => parts.join('/'),
|
||||
join: (...parts) => parts.join('/'),
|
||||
dirname: (p) => p.split('/').slice(0, -1).join('/'),
|
||||
basename: (p) => p.split('/').pop(),
|
||||
resolve: (...parts) => parts.join("/"),
|
||||
join: (...parts) => parts.join("/"),
|
||||
dirname: (p) => p.split("/").slice(0, -1).join("/"),
|
||||
basename: (p) => p.split("/").pop(),
|
||||
extname: (p) => {
|
||||
const parts = p.split('.');
|
||||
return parts.length > 1 ? '.' + parts.pop() : '';
|
||||
}
|
||||
const parts = p.split(".");
|
||||
return parts.length > 1 ? "." + parts.pop() : "";
|
||||
},
|
||||
};
|
||||
|
||||
export default path;
|
||||
@@ -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;
|
||||
@@ -1708,25 +1712,25 @@ export default class AccountViewView extends Vue {
|
||||
if (inputImportFileNameRef.value != null) {
|
||||
if (USE_DEXIE_DB) {
|
||||
await db
|
||||
.delete()
|
||||
.then(async () => {
|
||||
// BulkError: settings.bulkAdd(): 1 of 21 operations failed. Errors: ConstraintError: Key already exists in the object store.
|
||||
await Dexie.import(inputImportFileNameRef.value as Blob, {
|
||||
progressCallback: this.progressCallback,
|
||||
.delete()
|
||||
.then(async () => {
|
||||
// BulkError: settings.bulkAdd(): 1 of 21 operations failed. Errors: ConstraintError: Key already exists in the object store.
|
||||
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,7 +1821,9 @@ export default class AccountViewView extends Vue {
|
||||
if (!this.isRegistered) {
|
||||
// the user was not known to be registered, but now they are (because we got no error) so let's record it
|
||||
try {
|
||||
await databaseUtil.updateAccountSettings(did, { isRegistered: true });
|
||||
await databaseUtil.updateAccountSettings(did, {
|
||||
isRegistered: true,
|
||||
});
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
await db.settings.update(MASTER_SETTINGS_KEY, {
|
||||
@@ -1937,7 +1943,7 @@ export default class AccountViewView extends Vue {
|
||||
profileImageUrl: imgUrl,
|
||||
});
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
await db.open();
|
||||
await db.settings.update(MASTER_SETTINGS_KEY, {
|
||||
profileImageUrl: imgUrl,
|
||||
});
|
||||
@@ -2099,7 +2105,9 @@ export default class AccountViewView extends Vue {
|
||||
throw Error("Profile not saved");
|
||||
}
|
||||
} catch (error) {
|
||||
databaseUtil.logConsoleAndDb("Error saving profile: " + errorStringForLog(error));
|
||||
databaseUtil.logConsoleAndDb(
|
||||
"Error saving profile: " + errorStringForLog(error),
|
||||
);
|
||||
if (USE_DEXIE_DB) {
|
||||
logConsoleAndDb("Error saving profile: " + errorStringForLog(error));
|
||||
}
|
||||
@@ -2192,7 +2200,9 @@ export default class AccountViewView extends Vue {
|
||||
throw Error("Profile not deleted");
|
||||
}
|
||||
} catch (error) {
|
||||
databaseUtil.logConsoleAndDb("Error deleting profile: " + errorStringForLog(error));
|
||||
databaseUtil.logConsoleAndDb(
|
||||
"Error deleting profile: " + errorStringForLog(error),
|
||||
);
|
||||
if (USE_DEXIE_DB) {
|
||||
logConsoleAndDb("Error deleting profile: " + errorStringForLog(error));
|
||||
}
|
||||
|
||||
@@ -445,11 +445,13 @@ export default class Help extends Vue {
|
||||
}
|
||||
|
||||
public async testMessageEncryptionDecryption() {
|
||||
this.messageEncryptionTestResult = await cryptoLib.testMessageEncryptionDecryption();
|
||||
this.messageEncryptionTestResult =
|
||||
await cryptoLib.testMessageEncryptionDecryption();
|
||||
}
|
||||
|
||||
public async testSimpleEncryptionDecryption() {
|
||||
this.simpleEncryptionTestResult = await cryptoLib.testSimpleEncryptionDecryption();
|
||||
this.simpleEncryptionTestResult =
|
||||
await cryptoLib.testSimpleEncryptionDecryption();
|
||||
}
|
||||
|
||||
public async createJwtSimplewebauthn() {
|
||||
|
||||
Reference in New Issue
Block a user