feat: add suggest screen
This commit is contained in:
@@ -57,6 +57,12 @@ export class LumeStorage {
|
||||
|
||||
public async init() {
|
||||
const settings = await this.getAllSettings();
|
||||
const account = await this.getActiveAccount();
|
||||
|
||||
if (account) {
|
||||
this.currentUser = account;
|
||||
this.interests = await this.getInterests();
|
||||
}
|
||||
|
||||
for (const item of settings) {
|
||||
if (item.value.length > 10) {
|
||||
@@ -65,20 +71,6 @@ export class LumeStorage {
|
||||
this.settings[item.key] = !!parseInt(item.value);
|
||||
}
|
||||
}
|
||||
|
||||
const account = await this.getActiveAccount();
|
||||
|
||||
if (account) {
|
||||
this.currentUser = account;
|
||||
|
||||
const interests = await this.getInterests();
|
||||
if (interests) {
|
||||
interests.hashtags = interests.hashtags.map((item: string) =>
|
||||
item.replace("#", "").toLowerCase(),
|
||||
);
|
||||
this.interests = interests;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async #keyring_save(key: string, value: string) {
|
||||
@@ -430,7 +422,10 @@ export class LumeStorage {
|
||||
const results: { key: string; value: string }[] = await this.#db.select(
|
||||
"SELECT * FROM settings WHERE key = 'interests' ORDER BY id DESC LIMIT 1;",
|
||||
);
|
||||
|
||||
if (!results.length) return null;
|
||||
if (!results[0].value.length) return null;
|
||||
|
||||
return JSON.parse(results[0].value) as Interests;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user