|
1 | 1 | import { addDomElement, removeDomElement } from 'src/shared/helpers/dom'; |
2 | 2 | import { registerForPushNotifications } from 'src/shared/helpers/init'; |
3 | | -import LimitStore from 'src/shared/services/LimitStore'; |
| 3 | +import { |
| 4 | + limitGetLast, |
| 5 | + limitIsEmpty, |
| 6 | + limitStorePut, |
| 7 | +} from 'src/shared/services/limitStore2'; |
4 | 8 | import OneSignalEvent from 'src/shared/services/OneSignalEvent'; |
5 | 9 | import AnimatedElement from './AnimatedElement'; |
6 | 10 | import type Bell from './Bell'; |
@@ -66,16 +70,16 @@ export default class Button extends AnimatedElement { |
66 | 70 |
|
67 | 71 | _onHovering() { |
68 | 72 | if ( |
69 | | - LimitStore.isEmpty(this._events.mouse) || |
70 | | - LimitStore.getLast(this._events.mouse) === 'out' |
| 73 | + limitIsEmpty(this._events.mouse) || |
| 74 | + limitGetLast(this._events.mouse) === 'out' |
71 | 75 | ) { |
72 | 76 | OneSignalEvent._trigger(BellEvent._Hovering); |
73 | 77 | } |
74 | | - LimitStore.put(this._events.mouse, 'over'); |
| 78 | + limitStorePut(this._events.mouse, 'over'); |
75 | 79 | } |
76 | 80 |
|
77 | 81 | _onHovered() { |
78 | | - LimitStore.put(this._events.mouse, 'out'); |
| 82 | + limitStorePut(this._events.mouse, 'out'); |
79 | 83 | OneSignalEvent._trigger(BellEvent._Hovered); |
80 | 84 | } |
81 | 85 |
|
@@ -107,7 +111,7 @@ export default class Button extends AnimatedElement { |
107 | 111 | return; |
108 | 112 | } |
109 | 113 |
|
110 | | - const optedOut = LimitStore.getLast<boolean>('subscription.optedOut'); |
| 114 | + const optedOut = limitGetLast<boolean>('subscription.optedOut'); |
111 | 115 | if (this._bell._unsubscribed && !optedOut) { |
112 | 116 | // The user is actually subscribed, register him for notifications |
113 | 117 | registerForPushNotifications(); |
|
0 commit comments