Skip to content

Commit

Permalink
Replace use of removed state.browser.mobile with ConfigUtils.isMobile
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Feb 11, 2025
1 parent f81e50c commit 9c8f0ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actions/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import ReducerIndex from '../reducers/index';
import taskReducer from '../reducers/task';
import ConfigUtils from '../utils/ConfigUtils';
ReducerIndex.register("task", taskReducer);

export const SET_CURRENT_TASK = 'SET_CURRENT_TASK';
Expand All @@ -21,7 +22,7 @@ export function setCurrentTask(task, mode = null, mapClickAction = null, data =
}
// Attempt to read mapClickAction from plugin configuration block if not set
if (!mapClickAction) {
const device = getState().browser?.mobile ? 'mobile' : 'desktop';
const device = ConfigUtils.isMobile() ? 'mobile' : 'desktop';
mapClickAction = (getState().localConfig?.plugins?.[device] || []).find(config => config.name === task)?.mapClickAction;
}
dispatch({
Expand Down

0 comments on commit 9c8f0ea

Please sign in to comment.