mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-26 18:58:21 +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,
|
NotificationLevel.Important,
|
||||||
_('The default admin password is insecure and has not been changed! [Change it now](%s)', await ctx.models.user().profileUrl())
|
_('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> {
|
public async markAsRead(key: string): Promise<void> {
|
||||||
|
const n = await this.loadByKey(key);
|
||||||
|
if (!n) return;
|
||||||
|
|
||||||
await this.db(this.tableName)
|
await this.db(this.tableName)
|
||||||
.update({ read: 1 })
|
.update({ read: 1 })
|
||||||
.where('key', '=', key)
|
.where('key', '=', key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user