Skip to content

Commit

Permalink
Update branding, disable mobile guide, update room/list switch handling
Browse files Browse the repository at this point in the history
  • Loading branch information
octospacc committed Dec 27, 2023
1 parent 1bdfd45 commit 561430d
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 14 deletions.
105 changes: 105 additions & 0 deletions assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
"disable_guests": false,
"disable_login_language_selector": false,
"disable_3pid_login": false,
"brand": "Element",
"brand": "Spaccamient",
"branding": {
"auth_footer_links": [
{ "text": "Git", "url": "https://github.com/Spacc-Inc/Spaccamient" }
]
},
"integrations_ui_url": "https://scalar.vector.im/",
"integrations_rest_url": "https://scalar.vector.im/api",
"integrations_widgets_urls": [
Expand Down
22 changes: 11 additions & 11 deletions element-web/src/vector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,18 @@ async function start(): Promise<void> {
// verifying a 3pid (but after we've loaded the config)
// or if the user is following a deep link
// (https://github.com/vector-im/element-web/issues/7378)
const preventRedirect = fragparts.params.client_secret || fragparts.location.length > 0;
//const preventRedirect = fragparts.params.client_secret || fragparts.location.length > 0;

if (!preventRedirect) {
const isIos = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
const isAndroid = /Android/.test(navigator.userAgent);
if (isIos || isAndroid) {
if (document.cookie.indexOf("element_mobile_redirect_to_guide=false") === -1) {
window.location.href = "mobile_guide/";
return;
}
}
}
//if (!preventRedirect) {
// const isIos = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
// const isAndroid = /Android/.test(navigator.userAgent);
// if (isIos || isAndroid) {
// if (document.cookie.indexOf("element_mobile_redirect_to_guide=false") === -1) {
// window.location.href = "mobile_guide/";
// return;
// }
// }
//}

const loadOlmPromise = loadOlm();
// set the platform for react sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ export default class RoomHeader extends React.Component<IProps, IState> {
<AccessibleButton
className="mx_LegacyRoomHeader_button mx_BaseCard_back"
onClick={()=>{
document.getElementsByClassName('mx_LeftPanel_outerWrapper')[0].style.display="";
defaultDispatcher.dispatch<ViewRoomPayload>({
action: Action.ViewHomePage,
});
Expand Down
1 change: 0 additions & 1 deletion matrix-react-sdk/src/components/views/rooms/RoomTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ export class RoomTile extends React.PureComponent<ClassProps, State> {
metricsTrigger: "RoomList",
metricsViaKeyboard: ev.type !== "click",
});
document.getElementsByClassName('mx_LeftPanel_outerWrapper')[0].style.display="none";
};

private onActiveRoomUpdate = (isActive: boolean): void => {
Expand Down
3 changes: 3 additions & 0 deletions matrix-react-sdk/src/stores/RoomViewStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export class RoomViewStore extends EventEmitter {
wasContextSwitch: false,
viewingCall: false,
});
document.getElementsByClassName('mx_LeftPanel_outerWrapper')[0].style.display = "";
doClearCurrentVoiceBroadcastPlaybackIfStopped(this.stores.voiceBroadcastPlaybacksStore);
break;
case "MatrixActions.RoomState.events":
Expand Down Expand Up @@ -409,6 +410,8 @@ export class RoomViewStore extends EventEmitter {
});
}

document.getElementsByClassName('mx_LeftPanel_outerWrapper')[0].style.display = "none";

if (SettingsStore.getValue("feature_sliding_sync") && this.state.roomId !== payload.room_id) {
if (this.state.subscribingRoomId && this.state.subscribingRoomId !== payload.room_id) {
// unsubscribe from this room, but don't await it as we don't care when this gets done.
Expand Down

0 comments on commit 561430d

Please sign in to comment.