1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Server: Dismiss admin password notification when password has been changed

This commit is contained in:
Laurent Cozic 2021-01-12 16:02:44 +00:00
parent 5aa5089ae0
commit fb5eb1a47b
2 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,8 @@ export default async function(ctx: AppContext, next: KoaNext): Promise<void> {
NotificationLevel.Important,
_('The default admin password is insecure and has not been changed! [Change it now](%s)', await ctx.models.user().profileUrl())
);
} else {
await notificationModel.markAsRead('change_admin_password');
}
}

View File

@ -14,6 +14,9 @@ export default class NotificationModel extends BaseModel {
}
public async markAsRead(key: string): Promise<void> {
const n = await this.loadByKey(key);
if (!n) return;
await this.db(this.tableName)
.update({ read: 1 })
.where('key', '=', key)