feat: 🎸 add disconnect button to error page
This commit is contained in:
8 files changed
+46
-3
No files matched your search
@@ -71,6 +71,16 @@ export default class ApplicationRoute extends Route.extend(
|
||||
this.session.invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects from origin and invalidates session, thereby resetting
|
||||
* the client and reloading to the onboarding origin screen.
|
||||
*/
|
||||
@action
|
||||
disconnect() {
|
||||
this.origin.resetOrigin();
|
||||
this.invalidateSession();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hooks into ember-loading to kick off loading indicator in the
|
||||
* application template.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Service from '@ember/service';
|
||||
import { assert } from '@ember/debug';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { notifyError } from 'core/decorators/notify';
|
||||
|
||||
export default class OriginService extends Service {
|
||||
|
||||
@@ -72,4 +73,13 @@ export default class OriginService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the origin.
|
||||
*/
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
async resetOrigin() {
|
||||
this.rendererOrigin = null;
|
||||
await this.ipc.invoke('resetOrigin');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
{{page-title (t "errors.generic.title") }}
|
||||
|
||||
<main>
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Error::Message />
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Button @style="primary" {{on "click" (route-action "disconnect")}}>
|
||||
{{t "actions.disconnect"}}
|
||||
</Rose::Button>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
</main>
|
||||
Reference in new issue
Block a user