Skip to content

Commit

Permalink
v1.18.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Feb 22, 2024
1 parent f6d8934 commit 9c0805b
Show file tree
Hide file tree
Showing 19 changed files with 50 additions and 49 deletions.
1 change: 1 addition & 0 deletions changelogs/1.18.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bug fixes and performance improvements
12 changes: 6 additions & 6 deletions mobile/plugins/native-bottom-sheet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npx cap sync
* [`release(...)`](#release)
* [`openSelf(...)`](#openself)
* [`closeSelf(...)`](#closeself)
* [`setFullSize(...)`](#setfullsize)
* [`toggleSelfFullSize(...)`](#toggleselffullsize)
* [`openInMain(...)`](#openinmain)
* [`addListener('delegate', ...)`](#addlistenerdelegate)
* [`addListener('move', ...)`](#addlistenermove)
Expand Down Expand Up @@ -132,15 +132,15 @@ closeSelf(options: { key: BottomSheetKeys; }) => Promise<void>
--------------------


### setFullSize(...)
### toggleSelfFullSize(...)

```typescript
setFullSize(options: { isEnabled: boolean; }) => Promise<void>
toggleSelfFullSize(options: { isFullSize: boolean; }) => Promise<void>
```

| Param | Type |
| ------------- | ------------------------------------ |
| **`options`** | <code>{ isEnabled: boolean; }</code> |
| Param | Type |
| ------------- | ------------------------------------- |
| **`options`** | <code>{ isFullSize: boolean; }</code> |

--------------------

Expand Down
8 changes: 4 additions & 4 deletions mobile/plugins/native-bottom-sheet/dist/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@
"slug": "closeself"
},
{
"name": "setFullSize",
"signature": "(options: { isEnabled: boolean; }) => Promise<void>",
"name": "toggleSelfFullSize",
"signature": "(options: { isFullSize: boolean; }) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "{ isEnabled: boolean; }"
"type": "{ isFullSize: boolean; }"
}
],
"returns": "Promise<void>",
"tags": [],
"docs": "",
"complexTypes": [],
"slug": "setfullsize"
"slug": "toggleselffullsize"
},
{
"name": "openInMain",
Expand Down
4 changes: 2 additions & 2 deletions mobile/plugins/native-bottom-sheet/dist/esm/definitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export interface BottomSheetPlugin {
closeSelf(options: {
key: BottomSheetKeys;
}): Promise<void>;
setFullSize(options: {
isEnabled: boolean;
toggleSelfFullSize(options: {
isFullSize: boolean;
}): Promise<void>;
openInMain(options: {
key: BottomSheetKeys;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
CAP_PLUGIN_METHOD(release, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(openSelf, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(closeSelf, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(setFullSize, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(toggleSelfFullSize, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(openInMain, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(applyScrollPatch, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(clearScrollPatch, CAPPluginReturnPromise);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class BottomSheetPlugin: CAPPlugin, FloatingPanelControllerDelegate {
public var currentOpenSelfCall: CAPPluginCall?
var currentHalfY: CGFloat?
var prevStatusBarStyle: UIStatusBarStyle?
var wasHalfSize = true
public var isHalfSize = false

@objc func prepare(_ call: CAPPluginCall) {
ensureLocalOrigin()
Expand Down Expand Up @@ -192,7 +192,7 @@ public class BottomSheetPlugin: CAPPlugin, FloatingPanelControllerDelegate {
}
}

@objc func setFullSize(_ call: CAPPluginCall) {
@objc func toggleSelfFullSize(_ call: CAPPluginCall) {
ensureLocalOrigin()
ensureDelegated()

Expand All @@ -205,25 +205,19 @@ public class BottomSheetPlugin: CAPPlugin, FloatingPanelControllerDelegate {

let topVc = self.bridge!.viewController!.parent!.presentingViewController as! CAPBridgeViewController
let topBottomSheetPlugin = topVc.bridge!.plugin(withName: "BottomSheet") as! BottomSheetPlugin
let isFullSizeEnabled = call.getBool("isEnabled") == true
let layout = topBottomSheetPlugin.fpc.layout as! MyPanelLayout

if isFullSizeEnabled {
if layout.anchors[.full] != nil {
return
}
if !topBottomSheetPlugin.isHalfSize {
return
}

wasHalfSize = true
layout.anchors[.full] = layout.fullAnchor
topBottomSheetPlugin.animateTo(to: .full)
} else {
if !wasHalfSize {
return
}
let isFullSize = call.getBool("isFullSize") == true
let layout = topBottomSheetPlugin.fpc.layout as! MyPanelLayout

layout.anchors[.full] = nil
topBottomSheetPlugin.animateTo(to: .half)
if isFullSize && layout.anchors[.full] == nil {
layout.anchors[.full] = layout.fullAnchor
}

topBottomSheetPlugin.animateTo(to: isFullSize ? .full : .half)
}
}

Expand Down Expand Up @@ -269,12 +263,14 @@ public class BottomSheetPlugin: CAPPlugin, FloatingPanelControllerDelegate {
currentHalfY = screenHeight - screenHeight * newFractionalInset
toggleExtraScroll(false)
animateTo(to: .half)
isHalfSize = true
} else {
layout.anchors[.half] = nil
layout.anchors[.full] = layout.fullAnchor
currentHalfY = screenHeight - screenHeight * HALF_FRACTIONAL_INSET
toggleExtraScroll(true)
animateTo(to: .full)
isHalfSize = false
}
}

Expand All @@ -285,7 +281,7 @@ public class BottomSheetPlugin: CAPPlugin, FloatingPanelControllerDelegate {
return
}

wasHalfSize = false
isHalfSize = false
animateTo(to: .hidden)
}

Expand Down
2 changes: 1 addition & 1 deletion mobile/plugins/native-bottom-sheet/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface BottomSheetPlugin {

closeSelf(options: { key: BottomSheetKeys }): Promise<void>;

setFullSize(options: { isEnabled: boolean }): Promise<void>;
toggleSelfFullSize(options: { isFullSize: boolean }): Promise<void>;

openInMain(options: { key: BottomSheetKeys }): Promise<void>;

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mytonwallet",
"version": "1.18.7",
"version": "1.18.8",
"description": "The most feature-rich web wallet and browser extension for TON – with support of multi-accounts, tokens (jettons), NFT, TON DNS, TON Sites, TON Proxy, and TON Magic.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.7
1.18.8
6 changes: 3 additions & 3 deletions src/api/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ export async function migrateStorage(onUpdate: OnApiUpdate) {
await apiDb.sseConnections.bulkPut(items);
}
}

version = 9;
await storage.setItem('stateVersion', version);
}

version = 9;
await storage.setItem('stateVersion', version);
}

if (version === 9) {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/font-icons/crypto.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/components/swap/Swap.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@
}

.footerBlock {
--background-color: var(--color-background-window);

display: flex;
flex-direction: column;
gap: 1rem;
Expand All @@ -273,6 +275,8 @@
}

.footerBlockStatic {
--background-color: var(--color-background-first);

margin-top: 2rem;
}

Expand Down Expand Up @@ -409,7 +413,7 @@
height: 2.75rem;

:global(.Transition_slide) {
background: var(--color-background-first);
background: var(--background-color);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ function Modal({
useEffect(() => {
if (!IS_DELEGATED_BOTTOM_SHEET || !isCompact) return;

// Expand NBS to full size for a compact modal window inside NBS
BottomSheet.setFullSize({ isEnabled: !!isOpen });
// Expand NBS to full size for a compact modal inside NBS
BottomSheet.toggleSelfFullSize({ isFullSize: !!isOpen });
}, [isCompact, isOpen]);

useEffect(
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useDelegatedBottomSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function useDelegatedBottomSheet(
// Skip initial opening
if (forceFullNative !== undefined && prevForceFullNative === undefined) return;

BottomSheet.setFullSize({ isEnabled: forceFullNative });
BottomSheet.toggleSelfFullSize({ isFullSize: forceFullNative });
}, [forceFullNative, isDelegatedAndOpen]);

useLayoutEffect(() => {
Expand All @@ -121,7 +121,7 @@ export function useDelegatedBottomSheet(

preventScrollOnFocus(dialogEl);

BottomSheet.setFullSize({ isEnabled: true });
BottomSheet.toggleSelfFullSize({ isFullSize: true });
}

function onBlur(e: FocusEvent) {
Expand All @@ -131,7 +131,7 @@ export function useDelegatedBottomSheet(

blurTimeout = window.setTimeout(() => {
blurTimeout = undefined;
BottomSheet.setFullSize({ isEnabled: false });
BottomSheet.toggleSelfFullSize({ isFullSize: false });
}, BLUR_TIMEOUT);
}

Expand Down
4 changes: 2 additions & 2 deletions src/styles/brilliant-icons.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@font-face {
font-family: "brilliant-icons";
src: url("./brilliant-icons.woff?3fc0a837f7566a3ce86e0bd263244e2c") format("woff"),
url("./brilliant-icons.woff2?3fc0a837f7566a3ce86e0bd263244e2c") format("woff2");
src: url("./brilliant-icons.woff?d636859954b719dfc53722a9306dc08e") format("woff"),
url("./brilliant-icons.woff2?d636859954b719dfc53722a9306dc08e") format("woff2");
font-weight: normal;
font-style: normal;
}
Expand Down
Binary file modified src/styles/brilliant-icons.woff
Binary file not shown.
Binary file modified src/styles/brilliant-icons.woff2
Binary file not shown.

0 comments on commit 9c0805b

Please sign in to comment.