mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 17:33:55 +00:00
use the send-to-link function
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
||||
} from '../../../common/api/ontimeApi';
|
||||
import { projectDataPlaceholder } from '../../../common/models/ProjectData';
|
||||
import { userFieldsPlaceholder } from '../../../common/models/UserFields';
|
||||
import { openLink } from '../../../common/utils/linkUtils';
|
||||
import ModalLink from '../ModalLink';
|
||||
import PreviewExcel from '../upload-modal/preview/PreviewExcel';
|
||||
|
||||
@@ -101,8 +102,15 @@ export default function SheetsModal(props: SheetsModalProps) {
|
||||
const handleAuthenticate = () => {
|
||||
getSheetsAuthUrl().then((data) => {
|
||||
if (data !== 'bad') {
|
||||
window.open(data, '_blank', 'noreferrer');
|
||||
//TODO: can we detect when this window is closed
|
||||
openLink(data);
|
||||
window.addEventListener(
|
||||
'focus',
|
||||
() =>
|
||||
getSheetState(sheetRef.current?.value ?? '', worksheetRef.current?.value ?? '').then((data) =>
|
||||
setState(data),
|
||||
),
|
||||
{ once: true },
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -138,11 +138,6 @@ function createWindow() {
|
||||
});
|
||||
|
||||
win.setMenu(null);
|
||||
|
||||
win.webContents.setWindowOpenHandler(({ url }) => {
|
||||
shell.openExternal(url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
}
|
||||
|
||||
app.disableHardwareAcceleration();
|
||||
|
||||
Reference in New Issue
Block a user