File tree Expand file tree Collapse file tree
src/routes/(authenticated)/shares/user/outgoing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 onMount (() => {
6666 shares = $userShare .shares .map ((share ) => ({
6767 ... share ,
68+ paused: share .paused !== 0 ,
6869 limits: {
6970 intensity: share .limits .intensity ?? 100 ,
7071 duration: share .limits .duration ?? 30_000 ,
134135 u .outgoing [storeIndex ].shares [index ] = {
135136 ... u .outgoing [storeIndex ].shares [index ],
136137 ... share ,
138+ paused: share .paused ? 2 : 0 ,
137139 };
138140 return u ;
139141 });
249251 // Update the actual store shares
250252 UserShares .update ((current ) => {
251253 current .outgoing [storeIndex ].shares .forEach (
252- (share ) => (share .paused = paused )
254+ (share ) =>
255+ (share .paused = paused ? share .paused | 2 : share .paused & ~ 2 )
253256 );
254257 return current ;
255258 });
281284 UserShares .update ((current ) => {
282285 current .outgoing [storeIndex ].shares .forEach ((s ) => {
283286 if (s .id === share .id ) {
284- s .paused = paused ; // Update the store shares list
287+ s .paused = paused ? s . paused | 2 : s . paused & ~ 2 ; // Update the store shares list
285288 }
286289 });
287290 return current ;
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { Zap } from ' @lucide/svelte' ;
3- import type { V2UserSharesListItem } from ' $lib/api/internal/v2' ;
3+ import type { UserShareInfo , V2UserSharesListItem } from ' $lib/api/internal/v2' ;
44 import * as Avatar from ' $lib/components/ui/avatar' ;
55 import { Badge } from ' $lib/components/ui/badge' ;
66 import * as Table from ' $lib/components/ui/table' ;
5252 <MultiPauseToggle
5353 shockers ={$userShare .shares .map ((share ) => ({
5454 shockerId: share .id ,
55- paused: share .paused ,
55+ paused: share .paused !== 0 ,
5656 userShareUserId: $userShare .id ,
5757 }))}
5858 onPausedChange ={(paused ) => {
5959 UserShares .update ((current ) => {
60- current .outgoing [storeIndex ].shares .forEach ((share ) => (share .paused = paused ));
60+ current .outgoing [storeIndex ].shares .forEach (
61+ (share ) => (share .paused = paused ? share .paused | 2 : share .paused & ~ 2 )
62+ );
6163 return current ;
6264 });
6365 }}
You can’t perform that action at this time.
0 commit comments