Skip to content

Commit 0980bbd

Browse files
authored
chore: Release v0.3.7 (#2859)
2 parents b36106c + 2f5d6c2 commit 0980bbd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1098
-1579
lines changed

.github/workflows/build-eas.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ on:
1212
workflow_dispatch:
1313
inputs:
1414
profile:
15-
type: string
15+
type: choice
1616
default: preview
17-
description: "Build profile, preview or production"
17+
options:
18+
- preview
19+
- production
20+
description: "Build profile"
1821

1922
jobs:
2023
build:
@@ -54,4 +57,10 @@ jobs:
5457
with:
5558
name: app-ios
5659
path: apps/mobile/build.ipa
57-
retention-days: 5
60+
retention-days: 90
61+
62+
- name: Submit to App Store
63+
if: github.event.inputs.profile == 'production'
64+
run: |
65+
cd apps/mobile
66+
eas submit --platform ios --path build.ipa --non-interactive

CHANGELOG.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
## [0.3.6](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.6) (2025-02-20)
3+
## [0.3.7](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.7) (2025-02-24)
44

55

66
### Bug Fixes
@@ -224,6 +224,8 @@
224224
* lint ([dafaf0a](https://github.com/RSSNext/follow/commit/dafaf0a97d40a6df659a7869d7c11f5cf529dfe7))
225225
* list form width ([6487be1](https://github.com/RSSNext/follow/commit/6487be1c9f8c085f6722595d59f85d1176c503c5))
226226
* list unread dot position ([dad33a1](https://github.com/RSSNext/follow/commit/dad33a12db4b270801da6b8c621b3049e6672c27))
227+
* **listEntryCover:** fix the cover mistakely render as audio ([#2813](https://github.com/RSSNext/follow/issues/2813)) ([e73eb54](https://github.com/RSSNext/follow/commit/e73eb540ed8f9325392ba6ba5829350ee27ed31e))
228+
* lists fetch ([6fe8dc9](https://github.com/RSSNext/follow/commit/6fe8dc910f65e096343ad732bd19fef34f18b01e))
227229
* **lists:** fix duplicate addition issue in manage feeds functionality ([#2544](https://github.com/RSSNext/follow/issues/2544)) ([d77ed3c](https://github.com/RSSNext/follow/commit/d77ed3cb37424e97490bbf4883f9326acc446d54))
228230
* load dynamic render assets ([3499535](https://github.com/RSSNext/follow/commit/3499535b4091e3a82734c416528b0766e70f0b63))
229231
* load instagram image fail ([f8fd58f](https://github.com/RSSNext/follow/commit/f8fd58f78ec11bc221eb9190ac7b6a66dd858f9c)), closes [#1539](https://github.com/RSSNext/follow/issues/1539)
@@ -249,10 +251,14 @@
249251
* missing translation in pitcure masonry ([902d681](https://github.com/RSSNext/follow/commit/902d68180d1cc872cbe4435efbcae108f0d732b5))
250252
* mobile need login modal ([0fb16f2](https://github.com/RSSNext/follow/commit/0fb16f2352e9776731522204b838be59f66127a4))
251253
* mobile pop back to entry list will refresh data ([3c18768](https://github.com/RSSNext/follow/commit/3c18768968aeb4635933ae616c52de55b6fad2ab))
254+
* **mobile:** auth redirect and 2fa support ([#2829](https://github.com/RSSNext/follow/issues/2829)) ([cc51d86](https://github.com/RSSNext/follow/commit/cc51d861c92fe5cd884210aaefecc80bad581257))
252255
* **mobile:** background color ([9f6934f](https://github.com/RSSNext/follow/commit/9f6934f844c995a1dcbb326123420e6ee9b05a96))
253256
* **mobile:** can not load native module ([#2791](https://github.com/RSSNext/follow/issues/2791)) ([f226de5](https://github.com/RSSNext/follow/commit/f226de53ab664c252e7d0806dbfdfe91dcd8135d))
254257
* **mobile:** context menu crash when released too quickly ([#2732](https://github.com/RSSNext/follow/issues/2732)) ([1327f56](https://github.com/RSSNext/follow/commit/1327f5671c61f901537193cfe2960b7189c0a5a6))
258+
* **mobile:** disable scroll-to-top for timeline view selector ([3b5fb5f](https://github.com/RSSNext/follow/commit/3b5fb5febeb4b49d7d2943a205af3c8e5f5c3b9d))
255259
* **mobile:** improve responsive design in CornerPlayer ([949a07e](https://github.com/RSSNext/follow/commit/949a07ed0e3cb8b8ea582ebd926f143da7386736))
260+
* **mobile:** remove shadow from PlayerTabBar ([79631bb](https://github.com/RSSNext/follow/commit/79631bbcbc1212a307678b04dbfff93dda793b03))
261+
* **mobile:** revert ref bind for nav scroll view ref ([#2856](https://github.com/RSSNext/follow/issues/2856)) ([8a0049d](https://github.com/RSSNext/follow/commit/8a0049dc1585c72d9e79fe1471c52fc8851a124a))
256262
* **mobile:** svg background transparent ([#2820](https://github.com/RSSNext/follow/issues/2820)) ([6b991d3](https://github.com/RSSNext/follow/commit/6b991d379e608e1686ce88022b7bb57d6de6d11d))
257263
* **mobile:** unread style not working, bring views back ([#2765](https://github.com/RSSNext/follow/issues/2765)) ([fad9f94](https://github.com/RSSNext/follow/commit/fad9f944d57d5739d6edfa7749d9802438f361c8))
258264
* **mobile:** update email login style ([9019e9b](https://github.com/RSSNext/follow/commit/9019e9bbc6ebcdcbd8a0f21844e04f1df17dd84a))
@@ -262,6 +268,7 @@
262268
* modal bottom buttons align ([#1216](https://github.com/RSSNext/follow/issues/1216)) ([b97096d](https://github.com/RSSNext/follow/commit/b97096dbd06bb7687b6c1313de45d8e91dee25af))
263269
* modal close button overlaps the select content ([#1166](https://github.com/RSSNext/follow/issues/1166)) ([3c103ed](https://github.com/RSSNext/follow/commit/3c103ed15daeb1f57a001d615c047c303087ba46))
264270
* modal exiting transition type ([5bb0100](https://github.com/RSSNext/follow/commit/5bb01006ad04f8e5ed93076905b78b74ce293f79))
271+
* **modal:** adjust modal header drag and resize behavior ([38e8c6c](https://github.com/RSSNext/follow/commit/38e8c6c2f4517b550273f8f09cb136107d2bebf2))
265272
* **modal:** close button can not click on electron ([c544dfc](https://github.com/RSSNext/follow/commit/c544dfcc8d4613e8d4f6025dd8a60cf679881680))
266273
* **modal:** drawer modal layout symmetric padding ([7141e86](https://github.com/RSSNext/follow/commit/7141e869dfc9328e3eeeda909ea2ffc7e6dd0e34))
267274
* **modal:** fixed close modal button position ([78e9424](https://github.com/RSSNext/follow/commit/78e942473fff309e372708b56a59a9009d5bb0e9))
@@ -539,6 +546,7 @@
539546
* basic masonry entry list and entry content view ([#2493](https://github.com/RSSNext/follow/issues/2493)) ([e569681](https://github.com/RSSNext/follow/commit/e569681198cabbfeb4c8133e421533c37b1fd96d))
540547
* bigger font size in mobile ([3e9a92d](https://github.com/RSSNext/follow/commit/3e9a92d16a80139c851671748367f009a3af4de9))
541548
* bigger view selector ([973c0d2](https://github.com/RSSNext/follow/commit/973c0d214d13313372c4ced0c68ec3c85db4ef4b))
549+
* bring back lists in views ([aeaa29b](https://github.com/RSSNext/follow/commit/aeaa29b13b0466848d6b35d4a7da232834322888))
542550
* bring rehypeUrlToAnchor back ([6f0cc4d](https://github.com/RSSNext/follow/commit/6f0cc4d566c9f2f552f0fedf1a8e570a817e0f56)), closes [#1373](https://github.com/RSSNext/follow/issues/1373)
543551
* checkLanguage utils ([225e470](https://github.com/RSSNext/follow/commit/225e470db84649bd23657d82b3c6a71b94cccc5f))
544552
* collection panel active button status ([a1676fc](https://github.com/RSSNext/follow/commit/a1676fc535430c3bd4c614a5261e3152e1bf2561))
@@ -637,29 +645,36 @@
637645
* **mobile:** Add image headers for cross-origin image loading ([053517d](https://github.com/RSSNext/follow/commit/053517db633103fb0a7f8796684181f9f3d6688b))
638646
* **mobile:** add loading indicator for infinite scroll in entry list ([22ac1be](https://github.com/RSSNext/follow/commit/22ac1be1a5a82a1453ef200b25c49ce4f6d93ca6))
639647
* **mobile:** Add media preview accessories and no-media rendering support ([9113c0a](https://github.com/RSSNext/follow/commit/9113c0a2e53bdbc4c9b4e83f719198a83f6b7601))
648+
* **mobile:** add native iOS toast module with SPIndicator ([8dbb634](https://github.com/RSSNext/follow/commit/8dbb6343fb299a7b1e15288405d45bfb72dec09b))
640649
* **mobile:** add PortalProvider to EntryContentWebView and adjust ActivityIndicator ([713dc47](https://github.com/RSSNext/follow/commit/713dc47531f3e5fb4247cc9dc278ae2c6de6cdc6))
641650
* **mobile:** add preview image component with advanced gesture handling ([1d4e37e](https://github.com/RSSNext/follow/commit/1d4e37e35a36eaeacbea70723464a3759131cd2b))
642651
* **mobile:** add reader inline style rendering option ([160eb14](https://github.com/RSSNext/follow/commit/160eb14258f24afe08f5103b237e4391c09bd93e))
652+
* **mobile:** add reusable MediaCarousel component ([48461f1](https://github.com/RSSNext/follow/commit/48461f15e68f584372e75d41c51775d86300518f))
643653
* **mobile:** add social entry list component ([#2733](https://github.com/RSSNext/follow/issues/2733)) ([903b989](https://github.com/RSSNext/follow/commit/903b98953aa74fe472bf3793c6a4b8edbfe519bf))
644654
* **mobile:** add triggerAsChild prop to EntryReadHistory component ([#2773](https://github.com/RSSNext/follow/issues/2773)) ([c7b1513](https://github.com/RSSNext/follow/commit/c7b151394a2e3cfb73bb1c16b7f40d8256e65718))
655+
* **mobile:** audio player ([#2801](https://github.com/RSSNext/follow/issues/2801)) ([8e2dfe9](https://github.com/RSSNext/follow/commit/8e2dfe99c87d868e67f466ad2ed1687e95bf6882))
645656
* **mobile:** auto mark as read when scrolling ([#2781](https://github.com/RSSNext/follow/issues/2781)) ([c8f580c](https://github.com/RSSNext/follow/commit/c8f580c0a1f7228ebf390f293691213b762d4499))
646657
* **mobile:** deletion button ([79b4703](https://github.com/RSSNext/follow/commit/79b47030260e7667e23e725b2337922139b6ae6b))
647658
* **mobile:** enhance CORS handling and image loading in WebView ([ad06db9](https://github.com/RSSNext/follow/commit/ad06db9744f3b001a8bf0d004a1492e656091ab1))
648659
* **mobile:** enhance entry detail page with star and share actions ([970c932](https://github.com/RSSNext/follow/commit/970c9329d2ca0b8b163e59e03adab5d34c73f3ac))
649660
* **mobile:** Enhance grid view with dynamic media rendering and improved item handling ([27818f6](https://github.com/RSSNext/follow/commit/27818f6559bfb5b95bf529e38814eb6b83ad0d29))
650661
* **mobile:** enhance HTML renderer with image rendering and blurhash support ([b534667](https://github.com/RSSNext/follow/commit/b534667c059c7b60edaa9c0dfe6e2bfebe85fc7e))
651662
* **mobile:** enhance iOS image preview with SDWebImage and improved QuickLook handling ([0011861](https://github.com/RSSNext/follow/commit/0011861e3f9155ba4c28864f9bd7f452fdc2942e))
663+
* **mobile:** enhance player UI with floating tab bar and control improvements ([577f07f](https://github.com/RSSNext/follow/commit/577f07f85e3e7556cae5652a24317a8842c92316))
652664
* **mobile:** Enhance PreviewImage and EntryGridItem with interactive preview and animation ([bdff613](https://github.com/RSSNext/follow/commit/bdff6138676fe9c8c185861abfd03fa74f2f29c9))
665+
* **mobile:** enhance tab bar icon and label animations ([9c720a7](https://github.com/RSSNext/follow/commit/9c720a7d8c918234c9aef52405aca230b401c90e))
653666
* **mobile:** entry list by feed or category; pagination ([#2717](https://github.com/RSSNext/follow/issues/2717)) ([a63bb82](https://github.com/RSSNext/follow/commit/a63bb82935336a7f8efb5bc7e75cc2f6463d0a3c))
654667
* **mobile:** implement collection entry list ([#2787](https://github.com/RSSNext/follow/issues/2787)) ([c251aea](https://github.com/RSSNext/follow/commit/c251aeaf65c6a13668cbe984dedc49012a86eb98))
655668
* **mobile:** Implement global image preview with advanced gestures ([113c404](https://github.com/RSSNext/follow/commit/113c4045b79a5b5d81d644f68222063b006a1f5f))
656669
* **mobile:** implement native image preview with QuickLook on iOS ([975285e](https://github.com/RSSNext/follow/commit/975285ec30599fe297108c5aa3e8a163e9a27d14))
670+
* **mobile:** implement scroll-to-top functionality ([#2831](https://github.com/RSSNext/follow/issues/2831)) ([9b3439f](https://github.com/RSSNext/follow/commit/9b3439f71162824df7732f585a16dfc2e349ebdd))
657671
* **mobile:** improve entry list and detail view with UI refinements ([a527987](https://github.com/RSSNext/follow/commit/a52798729ec378b71367d6b90c6e65687cbe75b3))
658672
* **mobile:** introduce expo image ([9ea93b8](https://github.com/RSSNext/follow/commit/9ea93b80238f47788e0f984f03faf3c9a3434a81))
659673
* **mobile:** load archive entries ([#2725](https://github.com/RSSNext/follow/issues/2725)) ([d8a796d](https://github.com/RSSNext/follow/commit/d8a796d3ab4ca79496aef6e6597d2f9108d40058))
660674
* **mobile:** prefetch entry content ([03a1438](https://github.com/RSSNext/follow/commit/03a1438133ee809d15a757b300490de4c62f63a3))
661675
* **mobile:** refactor EntryList to use pager view ([#2802](https://github.com/RSSNext/follow/issues/2802)) ([714a933](https://github.com/RSSNext/follow/commit/714a93336118c381ca7046c13f79e2e700ee9cfe))
662676
* **mobile:** refresh control for entry list ([#2723](https://github.com/RSSNext/follow/issues/2723)) ([c01984d](https://github.com/RSSNext/follow/commit/c01984d50f0488b74893180a2a43ad59ba3ec36a))
677+
* **mobile:** render as read ([#2835](https://github.com/RSSNext/follow/issues/2835)) ([c0afb39](https://github.com/RSSNext/follow/commit/c0afb39788f72ef29bd814d97752fe438c3027e3))
663678
* **mobile:** unread state for entry ([#2730](https://github.com/RSSNext/follow/issues/2730)) ([ddd6a2c](https://github.com/RSSNext/follow/commit/ddd6a2c8cdf8fc6a06acd52345eb8c5b157c2e12))
664679
* **modal:** enhance Follow modal with improved navigation and loading state ([cf31c0f](https://github.com/RSSNext/follow/commit/cf31c0f5fae3fd6dac1e1e571e870ea57e05ed0b))
665680
* move feed to new category in context menu ([#2072](https://github.com/RSSNext/follow/issues/2072)) ([d684e14](https://github.com/RSSNext/follow/commit/d684e14056581744ac78ca697fa5ca059294245e))
@@ -676,6 +691,7 @@
676691
* optimize translation display ([3f01ce8](https://github.com/RSSNext/follow/commit/3f01ce87fae9e46fcbb330c24732c4733b9f7f59))
677692
* optimize translation display ([75b9135](https://github.com/RSSNext/follow/commit/75b9135a02fb6e94abb5c0670c9f12f354a88f0e))
678693
* optimize unread indicator styles ([f44b1a5](https://github.com/RSSNext/follow/commit/f44b1a5604af9ee1949f35af814dcda04af691d2))
694+
* optional daily ([d07ec23](https://github.com/RSSNext/follow/commit/d07ec236e5c90165638ab341623400f8f661d49d))
679695
* **podcast:** add PodcastButton component to mobile float bar ([#2514](https://github.com/RSSNext/follow/issues/2514)) ([037791e](https://github.com/RSSNext/follow/commit/037791eae13bf0b9322eba332a852f73cd737bd0))
680696
* prefer origin addresses for content images ([d4d4345](https://github.com/RSSNext/follow/commit/d4d43451dec839b64239e1835b2ac1a1aa2478be))
681697
* **profile:** enhance email management and avatar fallback for better mobile support ([#2776](https://github.com/RSSNext/follow/issues/2776)) ([4295dec](https://github.com/RSSNext/follow/commit/4295decfa9869599386499e405e2e30ba2796a80))
@@ -927,8 +943,8 @@
927943
* ci ([8852a81](https://github.com/RSSNext/follow/commit/8852a81d4cfe80a0704bcf52220c39e9ccbe98de))
928944
* ci and tootip portal ([3729917](https://github.com/RSSNext/follow/commit/37299173c8fcaf88d44b1a54baf7ddc03aa20ca6))
929945
* ci env `NODE_OPTIONS` max-old-space-size ([b4f9b1b](https://github.com/RSSNext/follow/commit/b4f9b1b8ea326b1613ca291ed5bbcd932c5e837a))
930-
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([4a14738](https://github.com/RSSNext/follow/commit/4a14738a99c7fd26dbf22c8de968a6896cbdc28b)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747)
931-
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([#1078](https://github.com/RSSNext/follow/issues/1078)) ([cd00a20](https://github.com/RSSNext/follow/commit/cd00a2064228890f4891f5b15825d1f5a0d681e9)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747)
946+
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([4a14738](https://github.com/RSSNext/follow/commit/4a14738a99c7fd26dbf22c8de968a6896cbdc28b))
947+
* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([#1078](https://github.com/RSSNext/follow/issues/1078)) ([cd00a20](https://github.com/RSSNext/follow/commit/cd00a2064228890f4891f5b15825d1f5a0d681e9))
932948
* **ci:** fetch all depth ([a504a12](https://github.com/RSSNext/follow/commit/a504a127bca93a6675b3ff02bcea0b1eca6e9707))
933949
* **ci:** nightly build ([a4ce7b1](https://github.com/RSSNext/follow/commit/a4ce7b16f476b8d72a0b1761709ec1ceba591242))
934950
* **ci:** nightly linux build ([702b1d9](https://github.com/RSSNext/follow/commit/702b1d976d52c49647d0433f2dd162c034d0abb4))

apps/main/src/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ function bootstrap() {
5959
}
6060
})
6161

62+
app.on("activate", () => {
63+
// On macOS it's common to re-create a window in the app when the
64+
// dock icon is clicked and there are no other windows open.
65+
mainWindow = getMainWindowOrCreate()
66+
mainWindow.show()
67+
})
68+
6269
// This method will be called when Electron has finished
6370
// initialization and is ready to create browser windows.
6471
// Some APIs can only be used after this event occurs.
@@ -158,13 +165,6 @@ function bootstrap() {
158165
},
159166
)
160167

161-
app.on("activate", () => {
162-
// On macOS it's common to re-create a window in the app when the
163-
// dock icon is clicked and there are no other windows open.
164-
mainWindow = getMainWindowOrCreate()
165-
mainWindow.show()
166-
})
167-
168168
app.on("open-url", (_, url) => {
169169
if (mainWindow && !mainWindow.isDestroyed()) {
170170
if (mainWindow.isMinimized()) mainWindow.restore()

apps/main/src/window.ts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export function createWindow(
4141
show: false,
4242
resizable: configs?.resizable ?? true,
4343
autoHideMenuBar: true,
44+
alwaysOnTop: false,
4445
webPreferences: {
4546
preload: path.join(__dirname, "../preload/index.mjs"),
4647
sandbox: false,

apps/mobile/babel.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = function (api) {
1212
"es-toolkit/compat": "../../node_modules/es-toolkit/dist/compat/index.js",
1313
"es-toolkit": "../../node_modules/es-toolkit/dist/index.js",
1414
"better-auth/react": "../../node_modules/better-auth/dist/react.js",
15+
"better-auth/client/plugins": "../../node_modules/better-auth/dist/client/plugins.js",
1516
"@better-auth/expo/client": "../../node_modules/@better-auth/expo/dist/client.js",
1617
},
1718
extensions: [".js", ".jsx", ".ts", ".tsx"],

apps/mobile/native/expo-module.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"platforms": ["apple", "android"],
33
"apple": {
4-
"modules": ["SharedWebViewModule", "HelperModule"]
4+
"modules": ["SharedWebViewModule", "HelperModule", "ToasterModule"]
55
},
66
"android": {
77
"modules": []

apps/mobile/native/ios/FollowNative.podspec

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Pod::Spec.new do |s|
2121
s.dependency 'ExpoModulesCore'
2222
s.dependency 'SnapKit', '~> 5.7.0'
2323
s.dependency 'SDWebImage', '~> 5.0'
24+
s.dependency 'SPIndicator', '~> 1.0.0'
2425
# Swift/Objective-C compatibility
2526
s.pod_target_xcconfig = {
2627
'DEFINES_MODULE' => 'YES',

apps/mobile/native/ios/SharedWebView/ModalWebViewController.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class ModalWebViewController: UIViewController {
5656
private func setupWebView() {
5757
view.addSubview(webView)
5858
webView.snp.makeConstraints { make in
59-
make.edges.equalToSuperview()
59+
make.top.equalTo(view.safeAreaLayoutGuide)
60+
make.left.right.bottom.equalToSuperview()
6061
}
6162
}
6263

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//
2+
// ToasterModule.swift
3+
//
4+
// Created by Innei on 2025/2/21.
5+
//
6+
7+
import ExpoModulesCore
8+
import SPIndicator
9+
10+
enum ToastType: String, Enumerable {
11+
case error
12+
case info
13+
case warn
14+
case success
15+
}
16+
17+
extension ToastType {
18+
func type() -> SPIndicatorIconPreset {
19+
switch self
20+
{
21+
case .error: .error
22+
case .warn: .custom(UIImage(systemName: "exclamationmark.triangle")!.withTintColor(.orange))
23+
case .info: .custom(UIImage(systemName: "info.circle")!.withTintColor(.blue))
24+
case .success: .done
25+
}
26+
}
27+
28+
func haptic() -> SPIndicatorHaptic {
29+
switch self {
30+
case .error: .error
31+
case .info: .success
32+
case .warn: .warning
33+
case .success: .error
34+
}
35+
}
36+
}
37+
struct ToastOptions: Record {
38+
@Field
39+
var message: String?
40+
@Field
41+
var type: ToastType = .info
42+
43+
@Field
44+
var duration: Double = 1.5
45+
@Field
46+
var title: String
47+
48+
}
49+
50+
public class ToasterModule: Module {
51+
public func definition() -> ModuleDefinition {
52+
Name("Toaster")
53+
54+
Function("toast") { (value: ToastOptions) in
55+
56+
DispatchQueue.main.sync {
57+
let indicatorView = SPIndicatorView(
58+
title: value.title, message: value.message, preset: value.type.type())
59+
indicatorView.present(duration: value.duration, haptic: value.type.haptic())
60+
}
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)