File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,18 @@ export const getCompanionWindow = createSelector(
2929 ( companionWindows , companionWindowId ) => companionWindowId && companionWindows [ companionWindowId ] ,
3030) ;
3131
32+ /**
33+ * Returns the companion window locale.
34+ * @param {object } state
35+ * @param {object } props
36+ * @param {string } props.companionWindowId
37+ * @returns {string|undefined }
38+ */
39+ export const getCompanionWindowLocale = createSelector (
40+ [ getCompanionWindow ] ,
41+ companionWindow => companionWindow && companionWindow . locale ,
42+ ) ;
43+
3244/**
3345 * Return position of thumbnail navigation in a certain window.
3446 * @param {object } state
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { createCachedSelector } from 're-reselect';
33import { PropertyValue , Utils , Resource } from 'manifesto.js' ;
44import getThumbnail from '../../lib/ThumbnailFactory' ;
55import asArray from '../../lib/asArray' ;
6- import { getCompanionWindow } from './companionWindows' ;
6+ import { getCompanionWindowLocale } from './companionWindows' ;
77import { getManifest } from './getters' ;
88import { getConfig } from './config' ;
99
@@ -22,11 +22,11 @@ function createManifestoInstance(json, locale) {
2222/** */
2323export const getLocale = createSelector (
2424 [
25- getCompanionWindow ,
25+ getCompanionWindowLocale ,
2626 getConfig ,
2727 ] ,
28- ( companionWindow = { } , config = { } ) => (
29- companionWindow . locale || config . language
28+ ( companionWindowLocale , config = { } ) => (
29+ companionWindowLocale || config . language
3030 ) ,
3131) ;
3232
You can’t perform that action at this time.
0 commit comments