Browse Source

added subscription to "success login"

thomas 3 years ago
parent
commit
fe5af06359

+ 3 - 3
src/assets/js/__message-util.ts

@@ -96,16 +96,16 @@ export function getSubPropertyChangeMessage(ucpId: string) {
 export function getSubLoginMessage(ucpId: string) {
 export function getSubLoginMessage(ucpId: string) {
   return getMessage({
   return getMessage({
     messageType: AppMessageType.Subscription,
     messageType: AppMessageType.Subscription,
-    messageName: "subscribe_property_change",
+    messageName: "subscribe_to_success_login",
     subscription: Subscription.General,
     subscription: Subscription.General,
     data: {
     data: {
       action: 'subscribe',
       action: 'subscribe',
       query: {
       query: {
         Events: {
         Events: {
           __args: {
           __args: {
-            where: { messageName: 'Success Login' },
+            where: { messageName: 'Success Login' }, // Success Logout
           },
           },
-          notification: true,
+          // notification: true,
         },
         },
       }
       }
     },
     },

+ 2 - 1
src/components/Subscription.vue

@@ -2,7 +2,8 @@
   <div>
   <div>
     <h3>SUBSCRIPTION</h3>
     <h3>SUBSCRIPTION</h3>
     <div v-if="subscription.subId">
     <div v-if="subscription.subId">
-      SubscriptionId: {{ subscription.subId }}
+      SubscriptionId: {{ subscription.subId }} <br/>
+      Listening to : {{ subscription.title }}
       <!-- <button
       <!-- <button
           :disabled="session.ucpId == null || subscription.subId == null"
           :disabled="session.ucpId == null || subscription.subId == null"
           @click="endSubscribePropertyChange"
           @click="endSubscribePropertyChange"

+ 3 - 3
src/components/UIClient.vue

@@ -149,7 +149,7 @@ type Message = {
 }
 }
 type Subscription = {
 type Subscription = {
   subId: string,
   subId: string,
-  messages: Message[],
+  title: string,
 }
 }
 @Component({
 @Component({
   components: {
   components: {
@@ -178,7 +178,7 @@ export default class UiClient extends Vue {
   
   
   subscription: Subscription = {
   subscription: Subscription = {
     subId: null,
     subId: null,
-    messages: [],
+    title: '',
   }
   }
 
 
     startLoading() {
     startLoading() {
@@ -332,7 +332,7 @@ export default class UiClient extends Vue {
     const subject = this.client.getStreamOfResponsesFromRequest(param.request)
     const subject = this.client.getStreamOfResponsesFromRequest(param.request)
 
 
     try {
     try {
-      
+      this.subscription.title = param.title
       this.subscription.subId = await new Promise((resolved, reject) => {
       this.subscription.subId = await new Promise((resolved, reject) => {
         subject.subscribe({
         subject.subscribe({
           next: (data) => {
           next: (data) => {