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:
parent
5aa5089ae0
commit
fb5eb1a47b
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user