addons/isl/src/externalMergeTool.tsxblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import serverAPI from './ClientToServerAPI';
b69ab319import {lazyAtom} from './jotaiUtils';
b69ab3110
b69ab3111export const externalMergeToolAtom = lazyAtom(() => {
b69ab3112 serverAPI.onConnectOrReconnect(() => {
b69ab3113 serverAPI.postMessage({
b69ab3114 type: 'getConfiguredMergeTool',
b69ab3115 });
b69ab3116 });
b69ab3117 return serverAPI
b69ab3118 .nextMessageMatching('gotConfiguredMergeTool', () => true)
b69ab3119 .then(event => event.tool);
b69ab3120}, undefined);