From 01ea4cbc87794298f627093227bbd406854e8029 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 27 Jan 2018 18:06:44 -0800 Subject: [PATCH] mark sensitive/spoiler scoped to instance --- routes/_components/status/Status.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/routes/_components/status/Status.html b/routes/_components/status/Status.html index 8072336..9217838 100644 --- a/routes/_components/status/Status.html +++ b/routes/_components/status/Status.html @@ -333,22 +333,30 @@ } return content }, - spoilerShown: ($spoilersShown, statusId) => $spoilersShown && $spoilersShown[statusId], - sensitiveShown: ($sensitivesShown, statusId) => $sensitivesShown && $sensitivesShown[statusId], + spoilerShown: ($spoilersShown, $currentInstance, statusId) => $spoilersShown && $spoilersShown[$currentInstance] && $spoilersShown[$currentInstance][statusId], + sensitiveShown: ($sensitivesShown, $currentInstance, statusId) => $sensitivesShown && $sensitivesShown[$currentInstance] && $sensitivesShown[$currentInstance][statusId], }, methods: { onClickSpoilerButton() { - let $spoilersShown = this.store.get('spoilersShown') || {} let statusId = this.get('statusId') - $spoilersShown[statusId] = !$spoilersShown[statusId] + let instanceName = this.store.get('currentInstance') + let $spoilersShown = this.store.get('spoilersShown') || {} + if (!$spoilersShown[instanceName]) { + $spoilersShown[instanceName] = {} + } + $spoilersShown[instanceName][statusId] = !$spoilersShown[instanceName][statusId] this.store.set({'spoilersShown': $spoilersShown}) this.hydrateContent() this.fire('recalculateHeight') }, onClickSensitiveMediaButton() { - let $sensitivesShown = this.store.get('sensitivesShown') || {} let statusId = this.get('statusId') - $sensitivesShown[statusId] = !$sensitivesShown[statusId] + let instanceName = this.store.get('currentInstance') + let $sensitivesShown = this.store.get('sensitivesShown') || {} + if (!$sensitivesShown[instanceName]) { + $sensitivesShown[instanceName] = {} + } + $sensitivesShown[instanceName][statusId] = !$sensitivesShown[instanceName][statusId] this.store.set({'sensitivesShown': $sensitivesShown}) this.fire('recalculateHeight') },