Bits & pieces

Summary: Added a command to let a file be opened by the OS, and some other small bits and pieces to make Flipper browser compatible.

Reviewed By: lblasa

Differential Revision: D32721748

fbshipit-source-id: a4ad1c2f662f4651ddf6c20c57e5af1e123914a8
This commit is contained in:
Michel Weststrate
2021-12-08 04:25:28 -08:00
committed by Facebook GitHub Bot
parent f5f9608098
commit eab4f0d3d3
11 changed files with 58 additions and 48 deletions

View File

@@ -22,20 +22,20 @@ export default (store: Store, logger: Logger) => {
const renderHost = getRenderHostInstance();
const onFocus = () => {
setImmediate(() => {
setTimeout(() => {
store.dispatch({
type: 'windowIsFocused',
payload: {isFocused: true, time: Date.now()},
});
});
}, 1);
};
const onBlur = () => {
setImmediate(() => {
setTimeout(() => {
store.dispatch({
type: 'windowIsFocused',
payload: {isFocused: false, time: Date.now()},
});
});
}, 1);
};
window.addEventListener('focus', onFocus);
window.addEventListener('blur', onBlur);