try(dashboard): slack integration window does not work (test 2)
This commit is contained in:
@@ -21,8 +21,11 @@ export function SlackIntegrationForm({
|
||||
}) {
|
||||
const { organizationId } = useAppParams();
|
||||
useWS(`/live/integrations/slack?organizationId=${organizationId}`, (res) => {
|
||||
// @ts-expect-error
|
||||
console.log('3. slack integration done', window.slackPopup);
|
||||
// @ts-expect-error
|
||||
if (window.slackPopup && typeof window.slackPopup.close === 'function') {
|
||||
console.log('4. close popup');
|
||||
// @ts-expect-error
|
||||
window.slackPopup.close();
|
||||
}
|
||||
@@ -38,11 +41,14 @@ export function SlackIntegrationForm({
|
||||
});
|
||||
const mutation = api.integration.createOrUpdateSlack.useMutation({
|
||||
async onSuccess(res) {
|
||||
console.log('1. onSuccess', res);
|
||||
|
||||
const url = res.slackInstallUrl;
|
||||
const width = 600;
|
||||
const height = 800;
|
||||
const left = window.screenX + (window.outerWidth - width) / 2;
|
||||
const top = window.screenY + (window.outerHeight - height) / 2.5;
|
||||
console.log('2. open popup');
|
||||
// @ts-expect-error
|
||||
window.slackPopup = window.open(
|
||||
url,
|
||||
|
||||
Reference in New Issue
Block a user