Skip to content

Commit

Permalink
バグ修正 (#651)
Browse files Browse the repository at this point in the history
* fix: glsl

* fix: EEW警報のイベント終了を短縮

* fix: earthquake history

* fix
  • Loading branch information
YumNumm authored Apr 17, 2024
1 parent 2e0051e commit a0bacc4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 117 deletions.
8 changes: 2 additions & 6 deletions app/lib/core/provider/eew/eew_alive_telegram.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,10 @@ class EewAliveChecker {
final happenedDiff = now.toUtc().difference(happenedTime).inSeconds;
final depth = eew.depth;

// EEW警報の場合、420秒でイベント終了と判定する
// M6.0以上 or EEW警報の場合、360秒でイベント終了と判定する
final isWarning = eew.isWarning ?? eew.headline?.contains('強い揺れ') ?? false;
if (isWarning) {
return happenedDiff > 420;
}
// M6.0以上の場合、360秒でイベント終了と判定する
final magnitude = eew.magnitude;
if (magnitude != null && magnitude >= 6.0) {
if ((magnitude != null && magnitude >= 6.0) || isWarning) {
return happenedDiff > 360;
}
// 深さ不明/150km未満の場合、地震発生/検知から250秒でイベント終了と判定する
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ class EarthquakeHistoryDetailsNotifier
(earthquake) => earthquake.eventId == eventId,
);
if (target != null) {
state = AsyncData(target);
if (target.intensityRegions != null) {
state = AsyncData(target);
} else {
ref.invalidateSelf();
}
}
}
});
Expand Down
62 changes: 1 addition & 61 deletions app/lib/feature/home/component/eew/eew_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import 'package:eqmonitor/core/component/intenisty/jma_forecast_lg_intensity_ico
import 'package:eqmonitor/core/provider/config/theme/intensity_color/intensity_color_provider.dart';
import 'package:eqmonitor/core/provider/config/theme/intensity_color/model/intensity_color_model.dart';
import 'package:eqmonitor/core/provider/eew/eew_alive_telegram.dart';
import 'package:eqmonitor/core/provider/websocket/websocket_provider.dart';
import 'package:eqmonitor/core/theme/build_theme.dart';
import 'package:eqmonitor/gen/fonts.gen.dart';
import 'package:extensions/extensions.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:intl/intl.dart';
Expand Down Expand Up @@ -40,65 +38,7 @@ class EewWidgets extends ConsumerWidget {
);
},
);

return Column(
children: [
if (kDebugMode)
Wrap(
spacing: 8,
runSpacing: 4,
children: [
FilledButton.tonal(
child: const Text('SAMPLE EEW Telegram'),
onPressed: () {
ref.read(websocketProvider).send('sample/eew');
},
),
FilledButton.tonal(
child: const Text('キャンセル報'),
onPressed: () {
ref.read(websocketProvider).send('sample/eew-cancel');
},
),
FilledButton.tonal(
onPressed: () async {
final earthquake =
RealtimePostgresInsertPayload<EarthquakeV1>(
schema: 'public',
table: 'earthquake',
commitTimestamp: DateTime.now(),
errors: [],
newData: EarthquakeV1(
eventId: int.parse(
DateFormat('yyyyMMddHHmmss').format(DateTime.now()),
),
status: 'test',
arrivalTime: DateTime.now(),
depth: 40,
epicenterCode: 101,
longitude: 40,
latitude: 140,
magnitude: 4.5,
maxIntensity: JmaIntensity.fiveLower,
maxLpgmIntensity: JmaLgIntensity.one,
originTime: DateTime.now(),
),
);
final json = {
...earthquake.toJson(
(p0) => p0.toJson(),
),
'eventType': 'INSERT',
};
ref.read(websocketMessagesProvider.notifier).emit(json);
},
child: const Text('EEW TEST'),
),
],
),
body,
],
);
return body;
}
}

Expand Down
60 changes: 12 additions & 48 deletions app/lib/feature/settings/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class SettingsScreen extends HookConsumerWidget {
title: const Text('このアプリケーションについて'),
subtitle: const Text('利用規約やプライバシーポリシーを確認できます'),
leading: const Icon(Icons.description),

onTap: () => const AboutThisAppRoute().push<void>(context),
),
ListTile(
Expand Down Expand Up @@ -161,25 +160,6 @@ class SettingsScreen extends HookConsumerWidget {
}

Future<void> _onInquiryTap(BuildContext context, WidgetRef ref) async {
// 問い合わせ方法を選択するダイアログを表示
final result = await showModalActionSheet<bool>(
context: context,
title: 'お問い合わせ方法を選択してください',
cancelLabel: 'キャンセル',
actions: [
const SheetAction(
key: true,
label: 'メールで問い合わせ',
),
const SheetAction(
key: false,
label: 'Xで問い合わせ',
),
],
);
if (result == null || !context.mounted) {
return;
}
unawaited(
showDialog<void>(
barrierDismissible: false,
Expand Down Expand Up @@ -216,34 +196,18 @@ Future<void> _onInquiryTap(BuildContext context, WidgetRef ref) async {
.join('&');
}

if (result) {
// メール
final uri = Uri(
scheme: 'mailto',
path: '[email protected]',
query: encodeQueryParameters(
<String, String>{
'subject': 'EQMonitor 問い合わせ: ',
'body': '\n[こちらに内容を記載してください]\n\n$base',
},
),
);
await launchUrl(uri);
} else {
// X
final uri = Uri(
scheme: 'https',
host: 'twitter.com',
path: 'messages/compose',
query: encodeQueryParameters(
<String, String>{
'recipient_id': '1443896594529619970',
'text': '\n[こちらに内容を記載してください]\n\n$base',
},
),
);
await launchUrl(uri, mode: LaunchMode.externalNonBrowserApplication);
}
// メール
final uri = Uri(
scheme: 'mailto',
path: '[email protected]',
query: encodeQueryParameters(
<String, String>{
'subject': 'EQMonitor 問い合わせ: ',
'body': '\n[こちらに内容を記載してください]\n\n$base',
},
),
);
await launchUrl(uri);
if (!context.mounted) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion app/shaders/introduction.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void main(void){
vec2 st = FlutterFragCoord().xy/resolution.xy;
st.x *= resolution.x/resolution.y;

float f = fbm(st*3.0 + time/50) / 4.0;
float f = fbm(st*3.0 + time/20) / 3.0;

vec3 v = vec3(
f,
Expand Down

0 comments on commit a0bacc4

Please sign in to comment.