mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-24 08:10:47 +00:00
15 lines
394 B
TypeScript
15 lines
394 B
TypeScript
import { RouteLocationRaw, useRouter } from 'vue-router';
|
|
|
|
export function useRouteBackOrDefault(to: RouteLocationRaw) {
|
|
const router = useRouter();
|
|
|
|
return () => {
|
|
// TODO: use history navigation once we have found a solution for filtering external history entries
|
|
// if (window.history.length > 2) {
|
|
// router.back();
|
|
// } else {
|
|
router.replace(to);
|
|
// }
|
|
};
|
|
}
|