Mute annoying error that occurs when ME_QUERY is not yet in cache
This commit is contained in:
parent
fdbdcb366e
commit
d0de5de269
|
|
@ -138,15 +138,22 @@ export default {
|
||||||
) {
|
) {
|
||||||
if (topic) {
|
if (topic) {
|
||||||
const query = ME_QUERY;
|
const query = ME_QUERY;
|
||||||
const { me } = store.readQuery({ query });
|
try {
|
||||||
if (me) {
|
const { me } = store.readQuery({ query });
|
||||||
const data = {
|
if (me) {
|
||||||
me: {
|
const data = {
|
||||||
...me,
|
me: {
|
||||||
lastTopic: topic,
|
...me,
|
||||||
},
|
lastTopic: topic,
|
||||||
};
|
},
|
||||||
store.writeQuery({ query, data });
|
};
|
||||||
|
store.writeQuery({ query, data });
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
if (!(error instanceof TypeError)) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
// otherwise, the store didn't contain the data, this is fine, we ignore it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue