From 0daf5c1883ee7dfd43b29c38dbd29f8042bc5bc9 Mon Sep 17 00:00:00 2001 From: Rish Date: Wed, 6 May 2020 12:43:29 +0530 Subject: [PATCH] Cleaned key regeneration message for Zapier on route change no issue - After a successful key regeneration, the success message stayed in Zapier integration even on navigating away to different page, this clears up any message state on away transition --- .../app/routes/settings/integrations/zapier.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ghost/admin/app/routes/settings/integrations/zapier.js b/ghost/admin/app/routes/settings/integrations/zapier.js index 4e8fed1aa0..ad971d21a8 100644 --- a/ghost/admin/app/routes/settings/integrations/zapier.js +++ b/ghost/admin/app/routes/settings/integrations/zapier.js @@ -1,7 +1,20 @@ import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; import CurrentUserSettings from '../../../mixins/current-user-settings'; +import {inject as service} from '@ember/service'; export default AuthenticatedRoute.extend(CurrentUserSettings, { + router: service(), + + init() { + this._super(...arguments); + this.router.on('routeWillChange', () => { + if (this.controller) { + this.controller.set('selectedApiKey', null); + this.controller.set('isApiKeyRegenerated', false); + } + }); + }, + beforeModel() { this._super(...arguments); return this.get('session.user')