mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 14:35:03 +00:00
20 lines
602 B
JavaScript
20 lines
602 B
JavaScript
import find from 'lodash/find';
|
|
|
|
export const isItemARequest = (item) => {
|
|
return item.hasOwnProperty('request') && ['http-request', 'graphql-request'].includes(item.type);
|
|
};
|
|
|
|
export const isItemAFolder = (item) => {
|
|
return !item.hasOwnProperty('request') && item.type === 'folder';
|
|
};
|
|
|
|
export const itemIsOpenedInTabs = (item, tabs) => {
|
|
return find(tabs, (t) => t.uid === item.uid);
|
|
};
|
|
|
|
export const scrollToTheActiveTab = () => {
|
|
const activeTab = document.querySelector('.request-tab.active');
|
|
if (activeTab) {
|
|
activeTab.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
}
|
|
}; |