mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
Fix standalone notes not being saved when not logged in (#1433)
Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
@@ -130,13 +130,6 @@ public class FeatureCategoryFragment
|
|||||||
@Override
|
@Override
|
||||||
public void onSendNoteClicked()
|
public void onSendNoteClicked()
|
||||||
{
|
{
|
||||||
if (!OsmOAuth.isAuthorized())
|
|
||||||
{
|
|
||||||
final Intent intent = new Intent(requireActivity(), OsmLoginActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final double[] center = Framework.nativeGetScreenRectCenter();
|
final double[] center = Framework.nativeGetScreenRectCenter();
|
||||||
final double lat = center[0];
|
final double lat = center[0];
|
||||||
final double lon = center[1];
|
final double lon = center[1];
|
||||||
@@ -150,6 +143,13 @@ public class FeatureCategoryFragment
|
|||||||
Editor.nativeCreateStandaloneNote(lat, lon, mPendingNoteText);
|
Editor.nativeCreateStandaloneNote(lat, lon, mPendingNoteText);
|
||||||
mPendingNoteText = "";
|
mPendingNoteText = "";
|
||||||
Toast.makeText(requireContext(), R.string.osm_note_toast, Toast.LENGTH_SHORT).show();
|
Toast.makeText(requireContext(), R.string.osm_note_toast, Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
if (!OsmOAuth.isAuthorized())
|
||||||
|
{
|
||||||
|
final Intent intent = new Intent(requireActivity(), OsmLoginActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
requireActivity().finish();
|
requireActivity().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,6 +170,13 @@ public class FeatureCategoryFragment
|
|||||||
Editor.nativeCreateStandaloneNote(lat, lon, noteText);
|
Editor.nativeCreateStandaloneNote(lat, lon, noteText);
|
||||||
mPendingNoteText = "";
|
mPendingNoteText = "";
|
||||||
Toast.makeText(requireContext(), R.string.osm_note_toast, Toast.LENGTH_SHORT).show();
|
Toast.makeText(requireContext(), R.string.osm_note_toast, Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
if (!OsmOAuth.isAuthorized())
|
||||||
|
{
|
||||||
|
final Intent intent = new Intent(requireActivity(), OsmLoginActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
requireActivity().finish();
|
requireActivity().finish();
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
|
|||||||
Reference in New Issue
Block a user