Summary: Added a setting "Match local fbsource chekout", which inverserly corresponds to the `ignore_local_pin` setting in `flipper-launcher.toml`. Reviewed By: passy Differential Revision: D19030456 fbshipit-source-id: deaaf4e873a00bbc4e8bd3034353cf580df95a36
41 lines
867 B
TypeScript
41 lines
867 B
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
import {Actions} from './index';
|
|
|
|
export type LauncherSettings = {
|
|
ignoreLocalPin: boolean;
|
|
};
|
|
|
|
export type Action = {
|
|
type: 'UPDATE_LAUNCHER_SETTINGS';
|
|
payload: LauncherSettings;
|
|
};
|
|
|
|
export const defaultLauncherSettings: LauncherSettings = {
|
|
ignoreLocalPin: false,
|
|
};
|
|
|
|
export default function reducer(
|
|
state: LauncherSettings = defaultLauncherSettings,
|
|
action: Actions,
|
|
): LauncherSettings {
|
|
if (action.type === 'UPDATE_LAUNCHER_SETTINGS') {
|
|
return action.payload;
|
|
}
|
|
return state;
|
|
}
|
|
|
|
export function updateLauncherSettings(settings: LauncherSettings): Action {
|
|
return {
|
|
type: 'UPDATE_LAUNCHER_SETTINGS',
|
|
payload: settings,
|
|
};
|
|
}
|