@@ -765,16 +765,11 @@ export default {
765765 ].filter (option => option .timestamp !== null )
766766 },
767767 },
768- watch: {
769- storeActions () {
770- this .filterAndEnrichQuickActions ()
771- },
772- },
773- async mounted () {
768+ mounted () {
774769 this .onWindowResize ()
775770 window .addEventListener (' resize' , this .onWindowResize )
776771 if (this .filteredQuickActions .length === 0 ) {
777- await this .filterAndEnrichQuickActions ()
772+ this .filterAndEnrichQuickActions ()
778773 }
779774 },
780775 methods: {
@@ -787,37 +782,35 @@ export default {
787782 formatted () {
788783 return shortRelativeDatetime (new Date (this .data .dateInt * 1000 ))
789784 },
790- async filterAndEnrichQuickActions () {
785+ filterAndEnrichQuickActions () {
791786 this .filteredQuickActions = []
792- const quickActions = this .mainStore .getQuickActions ().filter (action => action .accountId === this .data .accountId )
787+ const quickActions = this .mainStore .getQuickActionProcessed ().filter (action => action .accountId === this .data .accountId )
793788 for (const action of quickActions) {
794- const steps = await findAllStepsForAction (action .id )
795- const check = steps .every (step => {
796- if ([' markAsSpam' , ' applyTag' , ' markAsImportant' , ' markAsFavorite' ].includes (step .type ) && ! this .hasWriteAcl ) {
789+ const check = action .actionSteps .every (step => {
790+ if ([' markAsSpam' , ' applyTag' , ' markAsImportant' , ' markAsFavorite' ].includes (step .name ) && ! this .hasWriteAcl ) {
797791 return false
798792 }
799- if ([' markAsRead' , ' markAsUnread' ].includes (step .type ) && ! this .hasSeenAcl ) {
793+ if ([' markAsRead' , ' markAsUnread' ].includes (step .name ) && ! this .hasSeenAcl ) {
800794 return false
801795 }
802- if ([' moveThread' , ' deleteThread' ].includes (step .type ) && ! this .hasDeleteAcl ) {
796+ if ([' moveThread' , ' deleteThread' ].includes (step .name ) && ! this .hasDeleteAcl ) {
803797 return false
804798 }
805799 return true
806800 })
807- if (check) {
808- this .filteredQuickActions .push ({
809- ... action,
810- steps,
811- icon: steps[0 ]? .name ,
812- })
813- }
801+ if (check) {
802+ this .filteredQuickActions .push ({
803+ ... action,
804+ })
805+ }
806+
814807 }
815808 },
816809 async executeQuickAction (action ) {
817810 this .closeQuickActionsMenu ()
818811 this .quickActionLoading = true
819812 try {
820- for (const step of action .steps ) {
813+ for (const step of action .actionSteps ) {
821814 switch (step .name ) {
822815 case ' markAsSpam' :
823816 await this .onToggleJunk ()
0 commit comments