Skip to content
Extraits de code Groupes Projets
Valider 1b8fc58c rédigé par Christian Paul's avatar Christian Paul
Parcourir les fichiers

Convert a string to a number

parent 24af8881
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -106,7 +106,9 @@ export class DbRoomStore { ...@@ -106,7 +106,9 @@ export class DbRoomStore {
public async countEntries(): Promise<number> { public async countEntries(): Promise<number> {
const row = (await this.db.Get("SELECT COUNT(*) AS count FROM room_entries WHERE matrix_id IS NOT NULL AND remote_id IS NOT NULL")) || {}; const row = (await this.db.Get("SELECT COUNT(*) AS count FROM room_entries WHERE matrix_id IS NOT NULL AND remote_id IS NOT NULL")) || {};
// Our Sqlite wrapper returns a number – which is what we want.
let count = row.count; let count = row.count;
// Our PostgreSQL wrapper returns a string.
if (typeof count === 'string') { if (typeof count === 'string') {
count = Number.parseInt(count); count = Number.parseInt(count);
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter