2019-05-24 10:48:29 -04:00
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
|
|
export const setTitle = (pathMatch, ref, project) => {
|
2019-05-29 05:24:35 -04:00
|
|
|
if (!pathMatch) return;
|
|
|
|
|
2019-05-24 10:48:29 -04:00
|
|
|
const path = pathMatch.replace(/^\//, '');
|
|
|
|
const isEmpty = path === '';
|
|
|
|
|
2019-06-13 15:15:25 -04:00
|
|
|
/* eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings */
|
2019-05-24 10:48:29 -04:00
|
|
|
document.title = `${isEmpty ? 'Files' : path} · ${ref} · ${project}`;
|
|
|
|
};
|