-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make fileActions mixin standalone again.
In #6445 we introduced a dependency on isFilesAppActive for the fileActions mixin. We added it to ContextActions and BatchActions, but there are way more places where the mixin is used. That's why we add a computed to the mixin itself now. Because mixins belong to the options api we unfortunately cannot use composables directly and extract helper functions for that reason.
- Loading branch information
Showing
7 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './useActiveLocation' | ||
export * from './useIsFilesAppActive' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import { computed, ComputedRef, unref } from '@vue/composition-api' | ||
import { useRoute } from './useRoute' | ||
import { Route } from 'vue-router' | ||
|
||
export const activeApp = (route : Route) : string => { | ||
return route.path.split('/')[1] | ||
} | ||
|
||
export const useActiveApp = (): ComputedRef<string> => { | ||
const route = useRoute() | ||
return computed(() => { | ||
return unref(route).path.split('/')[1] | ||
return activeApp(unref(route)) | ||
}) | ||
} |