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