Browse Source

added subscription to "success login"

thomas 3 years ago
parent
commit
fe5af06359
3 changed files with 8 additions and 7 deletions
  1. 3 3
      src/assets/js/__message-util.ts
  2. 2 1
      src/components/Subscription.vue
  3. 3 3
      src/components/UIClient.vue

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

@@ -96,16 +96,16 @@ export function getSubPropertyChangeMessage(ucpId: string) {
 export function getSubLoginMessage(ucpId: string) {
   return getMessage({
     messageType: AppMessageType.Subscription,
-    messageName: "subscribe_property_change",
+    messageName: "subscribe_to_success_login",
     subscription: Subscription.General,
     data: {
       action: 'subscribe',
       query: {
         Events: {
           __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>
     <h3>SUBSCRIPTION</h3>
     <div v-if="subscription.subId">
-      SubscriptionId: {{ subscription.subId }}
+      SubscriptionId: {{ subscription.subId }} <br/>
+      Listening to : {{ subscription.title }}
       <!-- <button
           :disabled="session.ucpId == null || subscription.subId == null"
           @click="endSubscribePropertyChange"

+ 3 - 3
src/components/UIClient.vue

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