Skip to content

Commit

Permalink
Merge branch 'feature/virtual-rooms-1.2' of github.com:ONLYOFFICE/App…
Browse files Browse the repository at this point in the history
…Server into feature/virtual-rooms-1.2
  • Loading branch information
TimofeyBoyko committed Apr 21, 2022
2 parents 0428c3d + 41c505d commit 8c12ec3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const InfoItem = styled.div`
font-size: 13px;
line-height: 24px;
display: flex;
width: 360px;
width: 358px;
`;

const InfoItemLabel = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const PortalRenaming = (props) => {
portalNameFromSessionStorage || tenantAlias
);
const [portalNameDefault, setPortalNameDefault] = useState(
portalNameDefaultFromSessionStorage || portalName
portalNameDefaultFromSessionStorage || tenantAlias
);

const [showReminder, setShowReminder] = useState(false);
Expand All @@ -63,8 +63,7 @@ const PortalRenaming = (props) => {

const checkScroll = checkScrollSettingsBlock();

window.addEventListener("resize", checkInnerWidth);
window.addEventListener("resize", checkScroll);
window.addEventListener("resize", checkInnerWidth, checkScroll);

const scrollPortalName = checkScroll();

Expand All @@ -91,7 +90,10 @@ const PortalRenaming = (props) => {

useEffect(() => {
if (isLoadedSetting) setIsLoadedPortalRenaming(isLoadedSetting);
}, [isLoadedSetting]);
if (portalNameDefault) {
checkChanges();
}
}, [isLoadedSetting, portalNameDefault]);

const onSavePortalRename = () => {
setIsLoadingPortalNameSave(true);
Expand Down Expand Up @@ -124,9 +126,6 @@ const PortalRenaming = (props) => {
saveToSessionStorage("portalName", "");
setShowReminder(false);
}

//TODO: delete?
checkChanges();
};

const onValidateInput = (value) => {
Expand Down Expand Up @@ -177,10 +176,8 @@ const PortalRenaming = (props) => {
if (settingIsEqualInitialValue(value)) {
saveToSessionStorage("portalName", "");
saveToSessionStorage("portalNameDefault", "");
setShowReminder(false);
} else {
saveToSessionStorage("portalName", value);
setShowReminder(true);
}

checkChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,16 @@ class WelcomePageSettings extends React.Component {

componentDidMount() {
const { isLoaded, setIsLoadedWelcomePageSettings, tReady } = this.props;
const { greetingTitleDefault } = this.state;
window.addEventListener("resize", this.checkInnerWidth);

const isLoadedSetting = isLoaded && tReady;

if (isLoadedSetting) setIsLoadedWelcomePageSettings(isLoadedSetting);

if (greetingTitleDefault) {
this.checkChanges();
}
}

componentDidUpdate(prevProps, prevState) {
Expand Down

0 comments on commit 8c12ec3

Please sign in to comment.