debugging
This commit is contained in:
parent
30312e6f55
commit
371853de44
2 changed files with 8 additions and 4 deletions
|
|
@ -85,7 +85,7 @@ Clone of [T3 Chat](https://t3.chat/)
|
|||
### Final push
|
||||
|
||||
- [x] Private mode for greeting
|
||||
- [ ] Free mode
|
||||
- [x] Free mode
|
||||
- [ ] make things prettier
|
||||
- [ ] mobile adjustments
|
||||
- [ ] cloud per chat persistance
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { v } from 'convex/values';
|
|||
import { providerValidator } from './schema';
|
||||
import * as array from '../../utils/array';
|
||||
import * as object from '../../utils/object';
|
||||
import { internal } from './_generated/api';
|
||||
import { api, internal } from './_generated/api';
|
||||
import { Provider } from '../../types';
|
||||
import type { Doc } from './_generated/dataModel';
|
||||
|
||||
|
|
@ -88,9 +88,10 @@ export const set = mutation({
|
|||
session_token: v.string(),
|
||||
},
|
||||
handler: async (ctx, args) => {
|
||||
const session = await ctx.runQuery(internal.betterAuth.getSession, {
|
||||
sessionToken: args.session_token,
|
||||
const session = await ctx.runQuery(api.betterAuth.publicGetSession, {
|
||||
session_token: args.session_token,
|
||||
});
|
||||
console.log('Session', session);
|
||||
|
||||
if (!session) throw new Error('Invalid session token');
|
||||
|
||||
|
|
@ -101,6 +102,9 @@ export const set = mutation({
|
|||
)
|
||||
.first();
|
||||
|
||||
console.log('Trying to set', args.model_id, 'for', session.userId);
|
||||
console.log('Existing', !!existing);
|
||||
|
||||
if (args.enabled && existing) return; // nothing to do here
|
||||
|
||||
if (existing) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue