@@ -7,13 +7,6 @@ function togglePauseOnHover() {
7
7
config .update ((prevConf ) => ({
8
8
pauseOnHover: ! prevConf .pauseOnHover ,
9
9
}))
10
-
11
- push .info ({
12
- title: ` Pause on hover ${config .pauseOnHover .value ? ' enabled' : ' disabled' } ` ,
13
- message: config .pauseOnHover .value
14
- ? ' Notifications will be paused on hover.'
15
- : ' Notifications will not be paused on hover.' ,
16
- })
17
10
}
18
11
19
12
function toggleRtlIfNeeded() {
@@ -26,13 +19,6 @@ function togglePauseOnTouch() {
26
19
config .update ((prevConf ) => ({
27
20
pauseOnTouch: ! prevConf .pauseOnTouch ,
28
21
}))
29
-
30
- push .info ({
31
- title: ` Pause on touch ${config .pauseOnTouch .value ? ' enabled' : ' disabled' } ` ,
32
- message: config .pauseOnTouch .value
33
- ? ' Notifications will be paused on touch.'
34
- : ' Notifications will not be paused on touch.' ,
35
- })
36
22
}
37
23
38
24
function toggleQueue() {
@@ -43,6 +29,14 @@ function toggleQueue() {
43
29
}))
44
30
}
45
31
32
+ function toggleNoDupes() {
33
+ config .update ((prevConf ) => ({
34
+ avoidDuplicates: ! prevConf .avoidDuplicates ,
35
+ }))
36
+
37
+ if (config .avoidDuplicates .value ) state .hasProgress = true
38
+ }
39
+
46
40
const enqueuedLength = computed (() => queue .value .length )
47
41
const isEnqueueDisabled = computed (() => config .limit .value === Infinity )
48
42
const isSwipeDisabled = computed (() => ! config .pauseOnHover .value )
@@ -71,14 +65,18 @@ watch(
71
65
watch (config .limit , () => {
72
66
toggleRtlIfNeeded ()
73
67
})
68
+
69
+ const btnProps = {
70
+ class: ' ButtonBase SwitchButton' ,
71
+ role: ' switch' ,
72
+ }
74
73
</script >
75
74
76
75
<template >
77
76
<div class =" Controls" >
78
77
<button
79
78
v-if =" isMobile()"
80
- class =" ButtonBase SwitchButton"
81
- role =" switch"
79
+ v-bind =" btnProps"
82
80
:aria-checked =" config.pauseOnTouch.value"
83
81
@click =" togglePauseOnTouch"
84
82
>
@@ -87,27 +85,28 @@ watch(config.limit, () => {
87
85
88
86
<button
89
87
v-else
90
- class =" ButtonBase SwitchButton"
91
- role =" switch"
88
+ v-bind =" btnProps"
92
89
:aria-checked =" config.pauseOnHover.value"
93
90
@click =" togglePauseOnHover"
94
91
>
95
92
Pause on Hover
96
93
</button >
97
94
98
95
<button
99
- class = " ButtonBase SwitchButton "
96
+ v-bind = " btnProps "
100
97
:disabled =" isSwipeDisabled"
101
- role =" switch"
102
98
:aria-checked =" state.enableSwipe"
103
99
@click =" actions.toggleSwipe"
104
100
>
105
101
Clear on Swipe
106
102
</button >
107
103
104
+ <button v-bind =" btnProps" :aria-checked =" config.avoidDuplicates.value" @click =" toggleNoDupes" >
105
+ No Duplicates
106
+ </button >
107
+
108
108
<button
109
- class =" ButtonBase SwitchButton ButtonTooltip"
110
- role =" switch"
109
+ v-bind =" btnProps"
111
110
:aria-checked =" config.enqueue.value"
112
111
@click =" toggleQueue"
113
112
:disabled =" isEnqueueDisabled"
@@ -138,6 +137,7 @@ watch(config.limit, () => {
138
137
text-align : center ;
139
138
display : flex ;
140
139
justify-items : center ;
140
+ padding-right : 1rem ;
141
141
142
142
-webkit-appearance : none ;
143
143
appearance : none ;
@@ -148,30 +148,9 @@ watch(config.limit, () => {
148
148
background-size : auto 1rem ;
149
149
}
150
150
151
- .ButtonTooltip {
152
- width : 100% ;
153
- }
154
-
155
151
hr {
156
152
margin : 0.25rem 0 ;
157
153
border : 0 ;
158
154
border-bottom : 1px solid var (--divider-color );
159
155
}
160
156
</style >
161
-
162
- <style >
163
- .v-popper__wrapper {
164
- max-width : 160px ;
165
- }
166
-
167
- .v-popper__inner {
168
- background : var (--button-bg-color ) !important ;
169
- color : var (--button-color ) !important ;
170
- font-size : 0.825rem !important ;
171
- line-height : 1.35 ;
172
- }
173
-
174
- .v-popper__arrow-outer {
175
- border-color : var (--button-bg-color ) !important ;
176
- }
177
- </style >
0 commit comments