setting to disable remote tilt
This commit is contained in:
@@ -41,16 +41,18 @@ export function AppProvider({ children }: { children: ReactNode }) {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const cardIndex = tilt.findIndex((tilt) => !!tilt);
|
||||
if (localSettings.remoteTilt) {
|
||||
const cardIndex = tilt.findIndex((tilt) => !!tilt);
|
||||
|
||||
if (tilt[cardIndex]) {
|
||||
emitTilt(cardIndex, tilt[cardIndex]);
|
||||
} else {
|
||||
// cardIndex does not matter
|
||||
// all tilts for this user will be cleared
|
||||
emitTilt(0, { rotateX: 0, rotateY: 0 });
|
||||
if (tilt[cardIndex]) {
|
||||
emitTilt(cardIndex, tilt[cardIndex]);
|
||||
} else {
|
||||
// cardIndex does not matter
|
||||
// all tilts for this user will be cleared
|
||||
emitTilt(0, { rotateX: 0, rotateY: 0 });
|
||||
}
|
||||
}
|
||||
}, [tilt]);
|
||||
}, [tilt, localSettings]);
|
||||
|
||||
const handleSelect = (cardID: string) => {
|
||||
setSelectCardIndex(-1);
|
||||
|
||||
Reference in New Issue
Block a user