Added favicon and device suppression
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.5 KiB |
+26
-5
@@ -55,7 +55,13 @@ const client = new ApolloClient({
|
||||
]),
|
||||
cache: new InMemoryCache({
|
||||
possibleTypes: {
|
||||
IndiVector: ["NumberVector", "SwitchVector", "TextVector", "LightVector", "BLOBVector"],
|
||||
IndiVector: [
|
||||
"NumberVector",
|
||||
"SwitchVector",
|
||||
"TextVector",
|
||||
"LightVector",
|
||||
"BLOBVector",
|
||||
],
|
||||
},
|
||||
typePolicies: {
|
||||
Query: {
|
||||
@@ -139,8 +145,26 @@ const GETDEVICE = gql`
|
||||
${propertyVectorFragment}
|
||||
`;
|
||||
|
||||
const DEL_DEVICE = gql`
|
||||
subscription delIndiDevice {
|
||||
delIndiDevice
|
||||
}
|
||||
`;
|
||||
|
||||
client
|
||||
.subscribe({
|
||||
query: DEL_DEVICE,
|
||||
})
|
||||
.subscribe(({ data }) => {
|
||||
const res = client.readQuery({ query: GETDEVICES });
|
||||
client.writeQuery({
|
||||
query: GETDEVICES,
|
||||
data: { devices: res.devices.filter(d => d.id !== data.delIndiDevice) },
|
||||
});
|
||||
});
|
||||
|
||||
const NEW_PROPERTY = gql`
|
||||
subscription newProperty {
|
||||
subscription newIndiProp {
|
||||
newIndiProp {
|
||||
id
|
||||
name
|
||||
@@ -159,8 +183,6 @@ client
|
||||
query: NEW_PROPERTY,
|
||||
})
|
||||
.subscribe(({ data }) => {
|
||||
console.log(data.newIndiProp.id);
|
||||
console.log(data.newIndiProp.vector)
|
||||
const res = client.readQuery({
|
||||
query: GETDEVICE,
|
||||
variables: { id: data.newIndiProp.device.id },
|
||||
@@ -247,7 +269,6 @@ client
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user