Explorar o código

Added click to copy

Steven Fukase %!s(int64=5) %!d(string=hai) anos
pai
achega
824709e6ae

+ 5 - 2
src/client/js/components/Admin/SlackIntegration/AccessTokenSettings.jsx

@@ -32,8 +32,11 @@ const AccessTokenSettings = (props) => {
   };
   };
 
 
   const textboxClickHandler = () => {
   const textboxClickHandler = () => {
-    const a = navigator.permissions.query({ name: 'clipboard-write' });
-    console.log(a);
+    if (accessToken) {
+      navigator.clipboard.writeText(accessToken)
+        .then(() => { toastSuccess('Copied to clipboard') });
+    }
+
   };
   };
 
 
   return (
   return (

+ 1 - 0
src/client/js/components/Admin/SlackIntegration/SlackIntegration.jsx

@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
 import AppContainer from '../../../services/AppContainer';
 import AppContainer from '../../../services/AppContainer';
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { toastSuccess, toastError } from '../../../util/apiNotification';
 import { toastSuccess, toastError } from '../../../util/apiNotification';
+
 import AccessTokenSettings from './AccessTokenSettings';
 import AccessTokenSettings from './AccessTokenSettings';
 import OfficialBotSettings from './OfficialBotSettings';
 import OfficialBotSettings from './OfficialBotSettings';
 import CustomBotWithoutProxySettings from './CustomBotWithoutProxySettings';
 import CustomBotWithoutProxySettings from './CustomBotWithoutProxySettings';