Log commit hash

This commit is contained in:
Gilbert 2024-06-04 12:03:22 -05:00
parent 0e9c3a07fd
commit 8f7fc888a9
4 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,9 @@ import { SERVER_GQL_PATH } from './constants';
import { Toaster } from 'components/shared/Toast'; import { Toaster } from 'components/shared/Toast';
import { LogErrorBoundary } from 'utils/log-error'; import { LogErrorBoundary } from 'utils/log-error';
// @ts-ignore
console.log(`v-${__VERSION__}`);
const root = ReactDOM.createRoot( const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement, document.getElementById('root') as HTMLElement,
); );

View File

@ -47,7 +47,9 @@ export const Login = ({ onDone }: Props) => {
console.log('Handling google redirect back'); console.log('Handling google redirect back');
try { try {
await google.handleOAuthRedirectBack(); await google.handleOAuthRedirectBack();
// @ts-ignore
wallet = await google.getEthersWallet(); wallet = await google.getEthersWallet();
// @ts-ignore
const result = await signInWithEthereum(1, 'login', wallet); const result = await signInWithEthereum(1, 'login', wallet);
if (result.error) { if (result.error) {
setError(result.error); setError(result.error);

View File

@ -39,7 +39,9 @@ export const SignUp = ({ onDone }: Props) => {
setProvider('google'); setProvider('google');
try { try {
await google.handleOAuthRedirectBack(); await google.handleOAuthRedirectBack();
// @ts-ignore
wallet = await google.getEthersWallet(); wallet = await google.getEthersWallet();
// @ts-ignore
const result = await signInWithEthereum(1, 'signup', wallet); const result = await signInWithEthereum(1, 'signup', wallet);
if (result.error) { if (result.error) {
setError({ type: 'provider', message: result.error }); setError({ type: 'provider', message: result.error });

View File

@ -1,5 +1,7 @@
import { defineConfig, PluginOption } from 'vite'; import { defineConfig, PluginOption } from 'vite';
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
import { exec } from 'child_process';
import { promisify } from 'util';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
@ -16,5 +18,8 @@ export default defineConfig({
}, },
define: { define: {
'process.env': {}, 'process.env': {},
__VERSION__: JSON.stringify(
(await promisify(exec)('git rev-parse --short HEAD')).stdout.trim(),
),
}, },
}); });