diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-06-29 15:09:04 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-07-01 11:37:59 +0200 |
| commit | d8ef9a4b86d402d3d4191c0275f6f1007f3eeb1b (patch) | |
| tree | a05e106ba78eb1c9a9f856af9b6498acd4db35dd /gui/src/renderer/lib | |
| parent | 93f6361d14031d9644d6677c8eb51bf67e288666 (diff) | |
| download | mullvadvpn-d8ef9a4b86d402d3d4191c0275f6f1007f3eeb1b.tar.xz mullvadvpn-d8ef9a4b86d402d3d4191c0275f6f1007f3eeb1b.zip | |
Removed now unused transition rules and helper methods
Diffstat (limited to 'gui/src/renderer/lib')
| -rw-r--r-- | gui/src/renderer/lib/transition-rule.ts | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/gui/src/renderer/lib/transition-rule.ts b/gui/src/renderer/lib/transition-rule.ts deleted file mode 100644 index 91d5cd6d4c..0000000000 --- a/gui/src/renderer/lib/transition-rule.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Action } from 'history'; - -export interface ITransitionDescriptor { - name: string; - duration: number; -} - -export interface ITransitionFork { - forward: ITransitionDescriptor; - backward: ITransitionDescriptor; -} - -export interface ITransitionMatch { - direction: 'forward' | 'backward'; - descriptor: ITransitionDescriptor; -} - -export default class TransitionRule { - constructor(private from: string | null, private to: string, private fork: ITransitionFork) {} - - public match( - fromRoute: string | null, - toRoute: string, - action?: Action, - ): ITransitionMatch | null { - if (action !== 'POP' && (!this.from || this.from === fromRoute) && this.to === toRoute) { - return { - direction: 'forward', - descriptor: this.fork.forward, - }; - } - - if (action !== 'PUSH' && (!this.from || this.from === toRoute) && this.to === fromRoute) { - return { - direction: 'backward', - descriptor: this.fork.backward, - }; - } - - return null; - } -} |
