Comments (4)
Using optional chaining user?.photoURL
or v-if fix the issue but I do not understand why
from vuefire.
Maybe it's related, but after using the above workaround, I get this error on logout:
Uncaught (in promise) FirebaseError: Function where() called with invalid data. Unsupported field value: undefined.
My useCollection has a where where('user', '==', user.value?.uid),
to only get data from the logged in user as bellow:
const entries = useCollection<Entry>(
computed(() =>
query(
collection(db, 'entries').withConverter(dateConverter),
where('user', '==', user.value?.uid),
where('date', '>=', weekStart.value),
where('date', '<=', weekEnd.value),
),
),
{
ssrKey: 'entries',
},
);
So before my logout, I call store.$reset
which should "unbind" the useCollection
?
I'm not sure if it's the right way, but pinia does not have a build-in store.reset for setup store and vue-fire has un $unbind but only in the option API, so maybe i'm doing something wrong.
function $reset() {
projects.value = [];
priorities.value = [];
entries.value = [];
}
from vuefire.
I also get this, so I guess I'm doing something wrong when I try to force Vue to stop triggering my useCollection
when I logout.
[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core
from vuefire.
I wonder if this is not a bug with Nuxt 3, as clearly my "on loged out" should be called after the mount of the logout
page.
I even added a nextTick just to be sure !
async function logout() {
console.log('on logout');
const auth = useFirebaseAuth()!;
const localeRoute = useLocaleRoute();
const store = useIndexStore();
await navigateTo(
localeRoute({
name: 'logout',
}),
);
store.$reset();
await nextTick();
console.log('loged out');
await signOut(auth);
return navigateTo(
localeRoute({
name: 'login',
}),
);
}
from vuefire.
Related Issues (20)
- Unbind `useCollection` on logout
- Realtime Database does not allow `null` despite docs? HOT 1
- Documentation of useCurrentUser
- Session Cookie Options
- Firebase Auth tree shaking HOT 3
- GOOGLE_APPLICATION_CREDENTIAL alternative for monorepos HOT 8
- Make vue-fire compatible with Ionic ? HOT 10
- Broken: "firebase.json" file doesn't exist + import issue HOT 5
- documentation error HOT 1
- id field value is override by vuefire HOT 3
- typescript type definition not consistence: useDocument return null reference if document does not exist HOT 1
- Error when installing v3.1.20. - simple-git-hooks not recognized as a command HOT 6
- `databaseDefaultSerializer` exported incorrecly HOT 1
- Use multiple firestore databases HOT 1
- When using withConverter on collection it do not fetch inner refs
- returned values from `useDocument` and `useCollection` using a getter aren't reactive HOT 1
- `toFirestore` inside `globalFirestoreOptions.converter` is never called HOT 1
- Detect nested refs in custom classes
- ssrKey: false not working in useDocument HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuefire.