Add snack bar notification
This commit is contained in:
parent
345d9e76b5
commit
b2196be4ff
2 changed files with 15 additions and 9 deletions
ui/redux/actions
|
@ -290,10 +290,10 @@ export function doToggleLoopList(collectionId: string, loop: boolean, hideToast:
|
|||
type: ACTIONS.TOGGLE_LOOP_LIST,
|
||||
data: { collectionId, loop },
|
||||
});
|
||||
if (loop && !hideToast) {
|
||||
if (!hideToast) {
|
||||
dispatch(
|
||||
doToast({
|
||||
message: __('Loop is on.'),
|
||||
message: loop ? __('Loop is on.') : __('Loop is off.'),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -323,18 +323,18 @@ export function doToggleShuffleList(currentUri: string, collectionId: string, sh
|
|||
type: ACTIONS.TOGGLE_SHUFFLE_LIST,
|
||||
data: { collectionId, newUrls },
|
||||
});
|
||||
if (!hideToast) {
|
||||
dispatch(
|
||||
doToast({
|
||||
message: __('Shuffle is on.'),
|
||||
})
|
||||
);
|
||||
}
|
||||
} else {
|
||||
dispatch({
|
||||
type: ACTIONS.TOGGLE_SHUFFLE_LIST,
|
||||
data: { collectionId, newUrls: false },
|
||||
});
|
||||
}
|
||||
if (!hideToast) {
|
||||
dispatch(
|
||||
doToast({
|
||||
message: shuffle ? __('Shuffle is on.') : __('Shuffle is off.'),
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -432,5 +432,11 @@ export function toggleAutoplayNext() {
|
|||
const autoplayNext = makeSelectClientSetting(SETTINGS.AUTOPLAY_NEXT)(state);
|
||||
|
||||
dispatch(doSetClientSetting(SETTINGS.AUTOPLAY_NEXT, !autoplayNext, ready));
|
||||
|
||||
dispatch(
|
||||
doToast({
|
||||
message: autoplayNext ? __('Autoplay Next is off.') : __('Autoplay Next is on.'),
|
||||
})
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue