mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 05:07:43 +02:00
Combine into one application chat, inbox and home (#9865)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -26,6 +26,10 @@ export function isFavoritesLocation (loc: Location): boolean {
|
||||
return loc.path[2] === chatId && loc.path[3] === 'favorites'
|
||||
}
|
||||
|
||||
export function isAllLocation (loc: Location): boolean {
|
||||
return loc.path[2] === chatId && loc.path[3] === 'all'
|
||||
}
|
||||
|
||||
export function getCardIdFromLocation (loc: Location): Ref<Card> | undefined {
|
||||
if (loc.path[2] !== chatId) {
|
||||
return undefined
|
||||
@@ -78,6 +82,16 @@ export function navigateToFavorites (): void {
|
||||
navigate(loc)
|
||||
}
|
||||
|
||||
export function navigateToAll (): void {
|
||||
const loc = getCurrentResolvedLocation()
|
||||
|
||||
loc.path[2] = chatId
|
||||
loc.path[3] = 'all'
|
||||
delete loc.query?.message
|
||||
|
||||
navigate(loc)
|
||||
}
|
||||
|
||||
export async function resolveLocation (loc: Location): Promise<ResolvedLocation | undefined> {
|
||||
if (loc.path[2] !== chatId) {
|
||||
return undefined
|
||||
|
||||
Reference in New Issue
Block a user