Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[FIX] Invisible div on top of page #496

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import GDPRAgreement from '../../routes/GDPRAgreement';
import LeaveMessage from '../../routes/LeaveMessage';
import Register from '../../routes/Register';
import SwitchDepartment from '../../routes/SwitchDepartment';
import { Provider as StoreProvider, Consumer as StoreConsumer } from '../../store';
import { Provider as StoreProvider, Consumer as StoreConsumer, store } from '../../store';
import { visibility, isActiveSession } from '../helpers';

function isRTL(s) {
Expand Down Expand Up @@ -104,7 +104,17 @@ export class App extends Component {
handleRestore = () => {
parentCall('restoreWindow');
const { dispatch } = this.props;
dispatch({ minimized: false, undocked: false });
const { undocked } = this.props;
const dispatchRestore = () => dispatch({ minimized: false, undocked: false });
const dispatchEvent = () => {
dispatchRestore();
store.off('storageSynced', dispatchEvent);
}
if (undocked) {
store.on('storageSynced', dispatchEvent);
} else {
dispatchRestore();
}
}

handleOpenWindow = () => {
Expand Down
1 change: 1 addition & 0 deletions src/store/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default class Store {

const storedState = JSON.parse(e.newValue);
this.setStoredState(storedState);
this.emit('storageSynced');
});

window.addEventListener('load', () => {
Expand Down