fix: /friend start stop (no content)
Browse files
src/commands/friend/friend.tsx
CHANGED
|
@@ -33,13 +33,13 @@ export async function call(
|
|
| 33 |
if (trimmed === 'start') {
|
| 34 |
updatePrefs({ enabled: true })
|
| 35 |
launchTauri(logger())
|
| 36 |
-
return <FriendStartView onDone={
|
| 37 |
}
|
| 38 |
|
| 39 |
if (trimmed === 'stop') {
|
| 40 |
updatePrefs({ enabled: false })
|
| 41 |
stopTauri(logger())
|
| 42 |
-
return <FriendStopView onDone={
|
| 43 |
}
|
| 44 |
|
| 45 |
if (trimmed === 'status') {
|
|
@@ -84,9 +84,9 @@ function FriendManager({ onDone }: { onDone: LocalJSXCommandOnDone }) {
|
|
| 84 |
)
|
| 85 |
}
|
| 86 |
|
| 87 |
-
function FriendStopView({ onDone }: { onDone:
|
| 88 |
useEffect(() => {
|
| 89 |
-
const t = setTimeout(onDone, 1500)
|
| 90 |
return () => clearTimeout(t)
|
| 91 |
}, [onDone])
|
| 92 |
|
|
@@ -97,9 +97,9 @@ function FriendStopView({ onDone }: { onDone: () => void }) {
|
|
| 97 |
)
|
| 98 |
}
|
| 99 |
|
| 100 |
-
function FriendStartView({ onDone }: { onDone:
|
| 101 |
useEffect(() => {
|
| 102 |
-
const t = setTimeout(onDone, 1500)
|
| 103 |
return () => clearTimeout(t)
|
| 104 |
}, [onDone])
|
| 105 |
|
|
|
|
| 33 |
if (trimmed === 'start') {
|
| 34 |
updatePrefs({ enabled: true })
|
| 35 |
launchTauri(logger())
|
| 36 |
+
return <FriendStartView onDone={onDone} />
|
| 37 |
}
|
| 38 |
|
| 39 |
if (trimmed === 'stop') {
|
| 40 |
updatePrefs({ enabled: false })
|
| 41 |
stopTauri(logger())
|
| 42 |
+
return <FriendStopView onDone={onDone} />
|
| 43 |
}
|
| 44 |
|
| 45 |
if (trimmed === 'status') {
|
|
|
|
| 84 |
)
|
| 85 |
}
|
| 86 |
|
| 87 |
+
function FriendStopView({ onDone }: { onDone: LocalJSXCommandOnDone }) {
|
| 88 |
useEffect(() => {
|
| 89 |
+
const t = setTimeout(() => onDone(undefined, { display: 'skip' }), 1500)
|
| 90 |
return () => clearTimeout(t)
|
| 91 |
}, [onDone])
|
| 92 |
|
|
|
|
| 97 |
)
|
| 98 |
}
|
| 99 |
|
| 100 |
+
function FriendStartView({ onDone }: { onDone: LocalJSXCommandOnDone }) {
|
| 101 |
useEffect(() => {
|
| 102 |
+
const t = setTimeout(() => onDone(undefined, { display: 'skip' }), 1500)
|
| 103 |
return () => clearTimeout(t)
|
| 104 |
}, [onDone])
|
| 105 |
|