keep tilts synced
This commit is contained in:
@@ -45,6 +45,10 @@ export function AppProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user