From 3afeb5c90882a06b70bf611b0773ee4337b1e4b4 Mon Sep 17 00:00:00 2001
From: Joas Schilling <coding@schilljs.com>
Date: Tue, 30 Mar 2021 10:18:23 +0200
Subject: [PATCH] Remove notifications when retesting

Signed-off-by: Joas Schilling <coding@schilljs.com>
---
 apps/settings/js/usersettings.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/apps/settings/js/usersettings.js b/apps/settings/js/usersettings.js
index a02aae6fb6a..21a122094f5 100644
--- a/apps/settings/js/usersettings.js
+++ b/apps/settings/js/usersettings.js
@@ -10,6 +10,8 @@
 (function() {
 	'use strict';
 
+	var errorNotification;
+
 	/**
 	 * Model for storing and saving user settings
 	 *
@@ -25,8 +27,12 @@
 				return null;
 			}
 
+			if (errorNotification) {
+				errorNotification.hide();
+			}
+
 			if (data.status && data.status === 'error') {
-				OC.Notification.show(data.data.message, { type: 'error' });
+				errorNotification = OC.Notification.show(data.data.message, { type: 'error' });
 			}
 
 			if (_.isUndefined(data.data)) {
-- 
GitLab