Remember whether widget drawer was hidden per-room
Fixes #4850 Signed-off-by: Andrew (anoa) <anoa@openmailbox.org>
This commit is contained in:
parent
0463f0e581
commit
f032284eff
2 changed files with 28 additions and 3 deletions
|
@ -281,7 +281,7 @@ module.exports = React.createClass({
|
|||
this.setState({
|
||||
isPeeking: false,
|
||||
});
|
||||
|
||||
|
||||
// This won't necessarily be a MatrixError, but we duck-type
|
||||
// here and say if it's got an 'errcode' key with the right value,
|
||||
// it means we can't peek.
|
||||
|
@ -305,6 +305,20 @@ module.exports = React.createClass({
|
|||
_shouldShowApps: function(room) {
|
||||
if (!BROWSER_SUPPORTS_SANDBOX) return false;
|
||||
|
||||
// Check if user has prompted to close this app before
|
||||
// If so, do not show apps
|
||||
let showWidget = localStorage.getItem(
|
||||
room.roomId + "_show_widget_drawer");
|
||||
|
||||
console.warn(room);
|
||||
console.warn("Key is: " + room.roomId + "_show_widget_drawer");
|
||||
console.warn("showWidget is: " + showWidget);
|
||||
|
||||
if (showWidget == "false") {
|
||||
console.warn("We're blocking the widget from loading.");
|
||||
return false;
|
||||
}
|
||||
|
||||
const appsStateEvents = room.currentState.getStateEvents('im.vector.modular.widgets');
|
||||
// any valid widget = show apps
|
||||
for (let i = 0; i < appsStateEvents.length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue