mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-04-23 15:58:08 -04:00
a
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
VERSION = "8.9992"
|
||||
VERSION = "8.9993"
|
||||
|
||||
@@ -5,7 +5,7 @@ import { LinksContext, MemberContext, SiteContext } from '../../utils/contexts/'
|
||||
import { PageStore, ProfilePageStore } from '../../utils/stores/';
|
||||
import { PageActions, ProfilePageActions } from '../../utils/actions/';
|
||||
import { CircleIconButton, PopupMain } from '../_shared';
|
||||
import { translateString, inEmbeddedApp, inSelectMediaEmbedMode, isSelectMediaMode } from '../../utils/helpers/';
|
||||
import { translateString, inEmbeddedApp, inSelectMediaEmbedMode, isSelectMediaMode, isShareMediaDisabled } from '../../utils/helpers/';
|
||||
|
||||
class ProfileSearchBar extends React.PureComponent {
|
||||
constructor(props) {
|
||||
@@ -373,7 +373,7 @@ class NavMenuInlineTabs extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
const isSelectMediaMode = inSelectMediaEmbedMode();
|
||||
const shareMediaDisabled = inEmbeddedApp() && new URLSearchParams(window.location.search).get('share_media') === '0';
|
||||
const shareMediaDisabled = isShareMediaDisabled();
|
||||
|
||||
// Append action=select_media to links when in select mode
|
||||
const mediaLink = isSelectMediaMode
|
||||
|
||||
@@ -19,6 +19,27 @@ export function inEmbeddedApp() {
|
||||
}
|
||||
}
|
||||
|
||||
export function isShareMediaDisabled(): boolean {
|
||||
try {
|
||||
const params = new URL(globalThis.location.href).searchParams;
|
||||
const shareMedia = params.get('share_media');
|
||||
|
||||
if (shareMedia === '0') {
|
||||
sessionStorage.setItem('lms_share_media_disabled', 'true');
|
||||
return true;
|
||||
}
|
||||
|
||||
if (shareMedia === '1') {
|
||||
sessionStorage.removeItem('lms_share_media_disabled');
|
||||
return false;
|
||||
}
|
||||
|
||||
return sessionStorage.getItem('lms_share_media_disabled') === 'true';
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function isSelectMediaMode() {
|
||||
try {
|
||||
const params = new URL(globalThis.location.href).searchParams;
|
||||
|
||||
@@ -14,4 +14,4 @@ export * from './quickSort';
|
||||
export * from './requests';
|
||||
export { translateString } from './translate';
|
||||
export { replaceString } from './replacementStrings';
|
||||
export { inEmbeddedApp, inSelectMediaEmbedMode, isSelectMediaMode } from './embeddedApp';
|
||||
export { inEmbeddedApp, inSelectMediaEmbedMode, isSelectMediaMode, isShareMediaDisabled } from './embeddedApp';
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user