Improve some subtle bugs

This commit is contained in:
Matthias 2023-04-12 18:26:17 +02:00
parent 81a445f44c
commit 1fdd72908c
3 changed files with 7 additions and 7 deletions

View File

@ -181,18 +181,18 @@ const isResizableLayout = computed(() =>
['', 'sm', 'md', 'lg', 'xl'].includes(currentBreakpoint.value),
);
const isLayoutLocked = computed(() => {
return layoutStore.layoutLocked || !isResizableLayout;
return layoutStore.layoutLocked || !isResizableLayout.value;
});
const gridLayoutData = computed((): GridItemData[] => {
if (isResizableLayout) {
if (isResizableLayout.value) {
return layoutStore.dashboardLayout;
}
return [...layoutStore.getDashboardLayoutSm];
});
const layoutUpdatedEvent = (newLayout) => {
if (isResizableLayout) {
if (isResizableLayout.value) {
console.log('newlayout', newLayout);
console.log('saving dashboard');
layoutStore.dashboardLayout = newLayout;

View File

@ -177,10 +177,10 @@ const isResizableLayout = computed(() =>
['', 'sm', 'md', 'lg', 'xl'].includes(currentBreakpoint.value),
);
const isLayoutLocked = computed(() => {
return layoutStore.layoutLocked || !isResizableLayout;
return layoutStore.layoutLocked || !isResizableLayout.value;
});
const gridLayoutData = computed((): GridItemData[] => {
if (isResizableLayout) {
if (isResizableLayout.value) {
return layoutStore.tradingLayout;
}
return [...layoutStore.getTradingLayoutSm];

View File

@ -10,7 +10,7 @@ describe('formatters.ts', () => {
expect(formatPriceCurrency(5123.551123, 'USDT', 3)).toEqual('5123.551 USDT');
expect(formatPriceCurrency(5123.551123, 'USDT')).toEqual('5123.551 USDT');
expect(formatPriceCurrency(5123.551123, 'USDT', 5)).toEqual('5123.55112 USDT');
expect(formatPriceCurrency(5123.5511230000000001, 'USDT', 5)).toEqual('5123.55112 USDT');
expect(formatPriceCurrency(5123.551123000001, 'USDT', 5)).toEqual('5123.55112 USDT');
expect(formatPriceCurrency(0.00001, 'BTC', 5)).toEqual('0.00001 BTC');
});
@ -18,7 +18,7 @@ describe('formatters.ts', () => {
expect(formatPrice(5123.5123512)).toEqual('5123.5123512');
expect(formatPrice(5123.5123512, 8)).toEqual('5123.5123512');
expect(formatPrice(5123.5123512, 3)).toEqual('5123.512');
expect(formatPrice(5123.51200000000000001, 8)).toEqual('5123.512');
expect(formatPrice(5123.512000000001, 8)).toEqual('5123.512');
expect(formatPrice(0.001, 3)).toEqual('0.001');
expect(formatPrice(0.0019, 3)).toEqual('0.002');
expect(formatPrice(2.701e-9, 3)).toEqual('0');