Skip to content

Commit

Permalink
Hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmagoo committed Nov 12, 2023
1 parent 4220d6c commit 5c33d6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/nostr/NostrService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export default class NostrService {
this.connectToRelays();
}

reloadMultipleAccounts(){
console.log("reloading multiple accounts...")
this.profiles = this.plugin.settings.profiles;
this.multipleProfilesEnabled = true;
}

async connectToRelays() {
this.refreshRelayUrls();
this.connectedRelays = [];
Expand Down
3 changes: 2 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ export class NostrWriterSettingTab extends PluginSettingTab {
newProfileNicknameField &&
this.isValidNickname(newProfileNicknameField)
) {
new Notice("Yuppp");
this.plugin.settings.profiles.push({
profileNickname: newProfileNicknameField,
profilePrivateKey: newProfilePrivateKeyField,
});
await this.plugin.saveSettings();
this.refreshDisplay();
this.plugin.nostrService.reloadMultipleAccounts();
} else {
new Notice("Add a profile nickname & a valid nsec");
if (!this.isValidNickname(newProfileNicknameField)) {
Expand All @@ -201,6 +201,7 @@ export class NostrWriterSettingTab extends PluginSettingTab {
this.plugin.settings.profiles.splice(i, 1);
await this.plugin.saveSettings();
this.refreshDisplay();
this.plugin.nostrService.reloadMultipleAccounts();
new Notice("Profile successfully deleted.");
}
});
Expand Down

0 comments on commit 5c33d6d

Please sign in to comment.